Solved api error

Coding Help/Re-API Supported
Post Reply
User avatar
Luxurious
Mod Tester
Mod Tester
Egypt
Posts: 177
Joined: 6 years ago
Location: Egypt
Contact:

api error

#1

Post by Luxurious » 3 years ago

i tried to CONVIRT some plugin to our mode but i have gut 2 error
Capture.PNG
  1. #include < cstrike >
  2. #include < zombie_escape >
  3.  
  4.  
  5. native give_vip_ethereal(id)
  6. native give_vip_darknight(id)
  7. native give_vip_ak47balrog(id)
  8.  
  9. new const PLUGIN_INFO[ ] =
  10. {
  11.     "vip menu",
  12.     "1.0",
  13.     "texasik"
  14. }
  15.  
  16. enum _: pOptionVIP
  17. {
  18.     PAKI,
  19.     HP,
  20.     ARMOR
  21. }
  22.  
  23. new g_menuVipBlock[ 33 ] [ pOptionVIP ]
  24.  
  25. new g_menuBlockWeapon[ 33 ]
  26. new g_menuBlockWeapon2[ 33 ]
  27. new g_menuBlockWeapon3[ 33 ]
  28.  
  29. public plugin_init( )
  30. {
  31.     register_plugin( PLUGIN_INFO[ 0 ] , PLUGIN_INFO[ 1 ] , PLUGIN_INFO [ 2 ] )
  32.  
  33.     register_clcmd("vip_menu" , "ClCmd_VipMenu" )
  34.  
  35.     register_event( "HLTV" , "event_round_start" , "a" , "1=0" , "2=0" )
  36. }
  37.  
  38. public event_round_start( pPlayer )
  39. {
  40.     for(new i = 0; i < 33; i++)
  41.     {
  42.         if(is_user_connected(i))
  43.         {
  44.             if(g_menuVipBlock[i][ARMOR] >= 1) g_menuVipBlock[i][ARMOR] = 0
  45.             if(g_menuVipBlock[i][HP] >= 1) g_menuVipBlock[i][HP] = 0
  46.  
  47.  
  48.             if(g_menuBlockWeapon[i] >= 1) g_menuBlockWeapon[i] = 0
  49.             if(g_menuBlockWeapon2[i] >= 1) g_menuBlockWeapon2[i] = 0
  50.             if(g_menuBlockWeapon3[i] >= 1) g_menuBlockWeapon3[i] = 0
  51.         }
  52.     }
  53. }
  54.  
  55. public ClCmd_VipMenu( pPlayer )
  56. {
  57.     if(ze_is_user_zombie(pPlayer))
  58.     return;
  59.  
  60.     new g_AdminMenu = menu_create( "\wFull V.I.P \r[Menu]" , "ClCmd_VipMenu_Handler" )
  61.  
  62.     if( get_user_flags( pPlayer ) & ADMIN_RESERVATION && ze_is_user_zombie(pPlayer) && !is_user_alive(pPlayer))
  63.     menu_additem( g_AdminMenu , "\r[Full VIP's] \wWeapons" , "1" )
  64.     else
  65.     menu_additem( g_AdminMenu , "\r[Full VIP's] \wWeapons" , "1" )
  66.    
  67.     if( get_user_flags( pPlayer ) & ADMIN_RESERVATION && g_menuVipBlock[ pPlayer ] [ PAKI ] < 1 )
  68.     menu_additem( g_AdminMenu , "\r[Full VIP's] \wFree \y[100] \wPack's" , "2" , ADMIN_RESERVATION )
  69.     else
  70.     menu_additem( g_AdminMenu , "\d[Full VIP's] \wFree \y[100] \wPack's" , "2" , ADMIN_RESERVATION )
  71.    
  72.     if( get_user_flags( pPlayer ) & ADMIN_RESERVATION && g_menuVipBlock[ pPlayer ] [ HP ] < 1  && is_user_alive(pPlayer))
  73.     menu_additem( g_AdminMenu , "\r[Full VIP's] \wFree \y[100] \wHealth" , "3" , ADMIN_RESERVATION )
  74.     else
  75.     menu_additem( g_AdminMenu , "\r[Full VIP's] \wFree \y[100] \wHealth" , "3" , ADMIN_RESERVATION )
  76.    
  77.     if( get_user_flags( pPlayer ) & ADMIN_RESERVATION && g_menuVipBlock[ pPlayer ] [ ARMOR ] < 1  && !ze_is_user_zombie(pPlayer) && is_user_alive(pPlayer))
  78.     menu_additem( g_AdminMenu , "\r[Full VIP's] \wFree \y[200] \wArmor" , "4" , ADMIN_RESERVATION )
  79.     else
  80.     menu_additem( g_AdminMenu , "\r[Full VIP's] \wFree \y[100] \wArmor" , "4" , ADMIN_RESERVATION )
  81.    
  82.     if( ! ( get_user_flags( pPlayer ) & ADMIN_RESERVATION ) )
  83.     menu_setprop( g_AdminMenu , MPROP_EXITNAME , "\wExit^n\wNu ai acces la Menu \r[Full VIP's]! \w[Write]: \r/VIP" )
  84.     else
  85.     menu_setprop( g_AdminMenu , MPROP_EXITNAME , "Exit" )  
  86.  
  87.     menu_setprop( g_AdminMenu , MPROP_EXIT , MEXIT_ALL )
  88.  
  89.     menu_display( pPlayer , g_AdminMenu , 0 )  
  90. }
  91.  
  92. public ClCmd_VipMenu_Handler( pPlayer , pMenu, pItem )
  93. {
  94.     if ( pItem == MENU_EXIT || ~get_user_flags( pPlayer ) & ADMIN_RESERVATION)
  95.     {
  96.         menu_destroy( pMenu )
  97.         return PLUGIN_HANDLED;
  98.     }
  99.  
  100.     new pData[ 6 ], pName[ 64 ], pAccess, pCallback
  101.  
  102.     menu_item_getinfo( pMenu , pItem , pAccess , pData , charsmax( pData ) , pName , charsmax( pName ) , pCallback )
  103.  
  104.     new pKey = str_to_num( pData )
  105.  
  106.     switch( pKey )
  107.     {
  108.     case 1:
  109.         {      
  110.             if(ze_is_user_zombie(pPlayer) || is_user_alive(pPlayer))
  111.             {
  112.                 ClCmd_VipMenu( pPlayer )
  113.                 return PLUGIN_HANDLED;
  114.             }
  115.             weapon_menu_vip( pPlayer )
  116.             menu_destroy( pMenu )
  117.             return PLUGIN_HANDLED
  118.         }
  119.     case 2:
  120.         {
  121.             if(g_menuVipBlock[ pPlayer ] [ PAKI ] >= 1)
  122.             {
  123.                 PrintChatColor( pPlayer ,  "!yOn this map, you can not take !gPack's!y!" )
  124.                 ClCmd_VipMenu( pPlayer )
  125.                 return PLUGIN_HANDLED;
  126.             }
  127.  
  128.             ze_set_escape_coins( pPlayer , ze_get_escape_coins( pPlayer ) + 100 )
  129.             PrintChatColor( pPlayer ,  "!yYou took !g[Pack's]!y!" )
  130.             g_menuVipBlock[ pPlayer ] [ PAKI ]++
  131.             ClCmd_VipMenu( pPlayer )
  132.         }
  133.     case 3:
  134.         {
  135.             if(is_user_alive(pPlayer))
  136.             {
  137.                 ClCmd_VipMenu( pPlayer )
  138.                 return PLUGIN_HANDLED;
  139.             }
  140.             if(g_menuVipBlock[ pPlayer ] [ HP ] >=1)
  141.             {
  142.                 PrintChatColor( pPlayer ,  "!yIn this round, you can not take !gHealth" )
  143.                 ClCmd_VipMenu( pPlayer )
  144.                 return PLUGIN_HANDLED;
  145.             }
  146.  
  147.             set_user_health( pPlayer , get_user_health( pPlayer ) + 100 )
  148.             PrintChatColor( pPlayer ,  "!yYou took !g[Health]" )
  149.             g_menuVipBlock[ pPlayer ] [ HP ]++
  150.             ClCmd_VipMenu( pPlayer )       
  151.         }      
  152.     case 4:
  153.         {
  154.             if(ze_is_user_zombie(pPlayer) || is_user_alive(pPlayer))
  155.             {
  156.                 ClCmd_VipMenu( pPlayer )
  157.                 return PLUGIN_HANDLED;
  158.             }
  159.  
  160.             if(get_user_armor(pPlayer) >= 200)
  161.             {
  162.                 PrintChatColor( pPlayer ,  "!yYou have the most !gArmor" )
  163.                 set_user_armor(pPlayer, 200)
  164.                 ClCmd_VipMenu( pPlayer )
  165.                 return PLUGIN_HANDLED;
  166.             }
  167.  
  168.             if(g_menuVipBlock[ pPlayer ] [ ARMOR ] >= 1)
  169.             {
  170.                 PrintChatColor( pPlayer ,  "!yIn this round, you can not take !gArmor" )
  171.                 ClCmd_VipMenu( pPlayer )
  172.                 return PLUGIN_HANDLED;
  173.             }
  174.  
  175.             set_pev(pPlayer, pev_armorvalue, float(min(pev(pPlayer, pev_armorvalue)+200, 200)))
  176.             PrintChatColor( pPlayer ,  "!yYou took !g[Armor]" )
  177.             g_menuVipBlock[ pPlayer ] [ ARMOR ]++
  178.             ClCmd_VipMenu( pPlayer )
  179.         }  
  180.     }
  181.  
  182.     menu_destroy( pMenu )
  183.     return PLUGIN_HANDLED
  184. }
  185.  
  186. public weapon_menu_vip( pPlayer )
  187. {
  188.     new g_AdminMenu = menu_create( "\r[Full VIP's] \wWeapons" , "weapon_menu_vip_Handler" )
  189.    
  190.     if( get_user_flags( pPlayer ) & ADMIN_RESERVATION && g_menuBlockWeapon[ pPlayer ] < 1 )
  191.     menu_additem( g_AdminMenu , "\r[Full VIP's] \wEthereal \r|x2 Damage|" , "1" , ADMIN_RESERVATION )
  192.     else
  193.     menu_additem( g_AdminMenu , "\d[Full VIP's] \wEthereal \r|x2 Damage|" , "1" , ADMIN_RESERVATION )
  194.    
  195.     if( get_user_flags( pPlayer ) & ADMIN_RESERVATION && g_menuBlockWeapon2[ pPlayer ] < 1 )   
  196.     menu_additem( g_AdminMenu , "\r[Full VIP's] \wM4A1 DarkNight \r|x2 Damage|" , "2" , ADMIN_RESERVATION )
  197.     else
  198.     menu_additem( g_AdminMenu , "\d[Full VIP's] \wM4A1 DarkNight \r|x2 Damage|" , "2" , ADMIN_RESERVATION )
  199.    
  200.     if( get_user_flags( pPlayer ) & ADMIN_RESERVATION && g_menuBlockWeapon3[ pPlayer ] < 1 )
  201.     menu_additem( g_AdminMenu , "\r[Full VIP's] \wAk-47 Balrog \r|x2 Damage|" , "3" , ADMIN_RESERVATION )
  202.     else
  203.     menu_additem( g_AdminMenu , "\r[Full VIP's] \wAk-47 Balrog \r|x2 Damage|" , "3" , ADMIN_RESERVATION )
  204.  
  205.     menu_setprop( g_AdminMenu , MPROP_EXITNAME , "Exit" )
  206.  
  207.     menu_setprop( g_AdminMenu , MPROP_EXIT , MEXIT_ALL )
  208.  
  209.     menu_display( pPlayer , g_AdminMenu , 0 )  
  210. }
  211.  
  212. public weapon_menu_vip_Handler( pPlayer , pMenu, pItem )
  213. {
  214.     if ( pItem == MENU_EXIT || ~get_user_flags( pPlayer ) & ADMIN_RESERVATION)
  215.     {
  216.         menu_destroy( pMenu )
  217.         return PLUGIN_HANDLED;
  218.     }
  219.  
  220.     new pData[ 6 ], pName[ 64 ], pAccess, pCallback
  221.  
  222.     menu_item_getinfo( pMenu , pItem , pAccess , pData , charsmax( pData ) , pName , charsmax( pName ) , pCallback )
  223.  
  224.     new pKey = str_to_num( pData )
  225.  
  226.     switch( pKey )
  227.     {
  228.     case 1:
  229.         {
  230.             if(g_menuBlockWeapon[ pPlayer ] >= 1)
  231.             {
  232.                 PrintChatColor( pPlayer ,  "!yYou already took weapons in this round!" )
  233.                 weapon_menu_vip( pPlayer )
  234.                 return PLUGIN_HANDLED
  235.             }
  236.  
  237.             give_vip_ethereal(pPlayer)
  238.             PrintChatColor( pPlayer ,  "!yYou took !g[ Ethereal ]" )
  239.             g_menuBlockWeapon[ pPlayer ]++
  240.             weapon_menu_vip( pPlayer )
  241.             return PLUGIN_HANDLED
  242.         }
  243.     case 2:
  244.         {
  245.             if(g_menuBlockWeapon2[ pPlayer ] >= 1)
  246.             {
  247.                 PrintChatColor( pPlayer ,  "!yYou already took weapons in this round!" )
  248.                 weapon_menu_vip( pPlayer )
  249.                 return PLUGIN_HANDLED
  250.             }
  251.  
  252.             give_vip_darknight(pPlayer)
  253.             PrintChatColor( pPlayer ,  "!yYou took !g[ M4A1 DarkNight ]" )
  254.             g_menuBlockWeapon2[ pPlayer ]++
  255.             weapon_menu_vip( pPlayer )
  256.             return PLUGIN_HANDLED
  257.         }
  258.     case 3:
  259.         {
  260.             if(g_menuBlockWeapon3[ pPlayer ] >= 1)
  261.             {
  262.                 PrintChatColor( pPlayer ,  "!yYou already took weapons in this round!" )
  263.                 weapon_menu_vip( pPlayer )
  264.                 return PLUGIN_HANDLED
  265.             }
  266.  
  267.             give_vip_ak47balrog(pPlayer)
  268.             PrintChatColor( pPlayer ,  "!yYou took !g[ Ak-47 Balrog ]" )
  269.             g_menuBlockWeapon3[ pPlayer ]++
  270.             weapon_menu_vip( pPlayer )
  271.             return PLUGIN_HANDLED
  272.         }
  273.     }
  274.  
  275.     menu_destroy( pMenu )
  276.     return PLUGIN_HANDLED
  277. }
  278.  
  279. stock PrintChatColor( const id , const input[], any:...)
  280. {
  281.     new count = 1, players[32]
  282.     static msg[191]
  283.     vformat(msg, 190, input, 3)
  284.    
  285.     replace_all(msg, 190, "!g", "^4" ) // Green Color
  286.     replace_all(msg, 190, "!y", "^1" ) // Default Color
  287.     replace_all(msg, 190, "!team", "^3" ) // Team Color
  288.    
  289.     if (id) players[0] = id; else get_players(players, count, "ch")
  290.     {
  291.         for (new i = 0; i < count; i++)
  292.         {
  293.             if (is_user_connected(players[i]))
  294.             {
  295.                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText" ), _, players[i])
  296.                 write_byte(players[i]);
  297.                 write_string(msg);
  298.                 message_end();
  299.             }
  300.         }
  301.     }
  302. }
Last edited by Raheem 3 years ago, edited 1 time in total.
Reason: Resolved, just include <fun>
DRK Zombie-Escape V1.6
IP : 81.169.153.129:27015

User avatar
Luxurious
Mod Tester
Mod Tester
Egypt
Posts: 177
Joined: 6 years ago
Location: Egypt
Contact:

#2

Post by Luxurious » 3 years ago

Solved!
DRK Zombie-Escape V1.6
IP : 81.169.153.129:27015

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 4 guests