Code error

Coding Help/Re-API Supported
Post Reply
Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

Code error

#1

Post by Rain1153 » 5 years ago

  1. #include <zombie_escape>
  2. #include <cstrike>
  3. #define _PLUGIN "Darkness"
  4.  
  5. #define _COST                     30
  6.  
  7. #define _VERSION                "1.0"
  8. #define _AUTHOR              "H.RED.ZONE"
  9.  
  10. new _gItemID
  11.  
  12. public plugin_init( ) {
  13.     register_plugin( _PLUGIN, _VERSION, _AUTHOR )
  14.    
  15.     _gItemID = ze_register_item( _PLUGIN, _COST )
  16. }
  17.  
  18. public ze_select_item_post( plr, _itemid) {
  19.     if ( _itemid == _gItemID ) {
  20.        
  21.         if( is_user_alive(plr) ) {
  22.             server_cmd( "ze_lighting_style a" )
  23.             set_hudmessage( 255, 0, 0, 0.25, 0.46, 0, 6.0, 12.0 )
  24.             show_hudmessage( 0, "Player bought DARKNESS for 15 sec" )
  25.             set_task( 15.0 , "_FW_RemoveDarkness", plr )
  26.         }
  27.     }
  28.     return ZE_ITEM_AVAILABLE;
  29. }
  30.  
  31. public ze_select_item_pre(plr, _itemid)
  32. {
  33.     // Return Available and we will block it in Post, So it dosen't affect other plugins
  34.     if (_itemid != _gItemID)
  35.         return ZE_ITEM_AVAILABLE
  36.    
  37.     // Available for zombies only
  38.     if (!ze_is_user_zombie(plr))
  39.         return ZE_ITEM_DONT_SHOW
  40.    
  41.     return ZE_ITEM_AVAILABLE
  42. }
  43.  
  44.  
  45. public _FW_RemoveDarkness( plr ) {
  46.    
  47.     server_cmd("ze_lighting_style z")
  48.     set_hudmessage(255, 0, 0, 0.25, 0.46, 0, 6.0, 12.0)
  49.     show_hudmessage(0, "DARKNESS IS GONE.")
  50. }  
  51. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  52. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
  53. */
Converted this but there is an error just compile it and see it for yourself ..thanks
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#2

Post by Raheem » 5 years ago

You missed to add the limit when you register the item,
change ze_register_item( _PLUGIN, _COST ) to ze_register_item( _PLUGIN, _COST, 0)
He who fails to plan is planning to fail

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 2 guests