Senior Member
|
12-26-2011
, 02:51
Re: [REQ] Fix Already On
|
#5
|
Quote:
Originally Posted by Splot
try it :
PHP Code:
#include <amxmodx> #include <cstrike> #include <fun> #include <colorchat>
#define PLUGIN "Ammo" #define VERSION "1.0" #define AUTHOR "Asaf Mazon"
new bool:g_AlreadyStealth [ 33 ] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /ammo", "ammo"); register_event("HLTV", "event_round_start", "a", "1=0", "2=0") }
public client_connect ( id ) { g_AlreadyStealth [ id ] = false } public event_round_start( id ) { g_AlreadyStealth [ id ] = false }
public ammo(id) { new menu = menu_create("Stealth", "ammo3"); menu_additem(menu, "\wStealth", "1", 0); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); return PLUGIN_HANDLED; }
public ammo3(id, menu, item) { if(item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_HANDLED; } new data[6], szName[64]; new access, callback; menu_item_getinfo(menu, item, access, data,5, szName,63, callback); new key = str_to_num(data); switch(key) { case 1: { if(g_AlreadyStealth[id] == true) { ColorChat(id, NORMAL, "You already bought^x04 Stealth^x01 in this round."); return PLUGIN_HANDLED; } else { g_AlreadyStealth[id] = true; set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 7) ColorChat(id, NORMAL, "you have bought^x04 Flashbang."); set_task(15.0, "REMOVE", id) } } } menu_destroy(menu); return PLUGIN_HANDLED; }
public REMOVE(id) { set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 250) }
נסה לסדר יותר תקוד שלך , תקפיד על רווחים כדי שהקוד יהיה יותר מובן .
הורדתי לך כמה דברים כמו TAG .
שלא הגדרת אותו .
חוצמזה היית צריך לשנות את זה:
PHP Code:
set_task(15.0, "REMOVE")
ל:
PHP Code:
set_task(15.0, "REMOVE", id)
תהנה .
|
You are not allowed to use other languages then English in this forums.
PHP Code:
#include <amxmodx> #include <fun> #include <colorchat>
new bool:g_bHaveStealth[33];
public client_connect(plr) { g_bHaveStealth[plr] = false; }
public FwdRoundStart() { new players[32], num, player; get_players(players, num); for(new i = 0; i < num; ++i) { player = players[i]; g_bHaveStealth[player] = false; } }
public plugin_init() { register_clcmd("say /ammo", "menu"); register_event("HLTV", "FwdRoundStart", "a", "1=0", "2=0"); }
public menu( iIndex ) { new iMenu = menu_create( "Menu name", "menu_handler" ); menu_additem( iMenu, "\wStealth", "1" ); menu_setprop( iMenu, MPROP_EXIT, MEXIT_ALL ); menu_display( iIndex, iMenu, 0 ); }
public menu_handler( iIndex, iMenu, iItem ) { if( iItem == MENU_EXIT ) { menu_destroy( iMenu ); return PLUGIN_HANDLED; } new iData[ 64 ], iName[ 64 ], iAccess, iCallBack; menu_item_getinfo( iMenu, iItem, iAccess, iData, sizeof iData - 1, iName, sizeof iName - 1, iCallBack ); new iKey = str_to_num( iData ); switch( iKey ) { case 1: { if( g_bHaveStealth[iIndex] ) { ColorChat(iIndex, NORMAL, "You already bought^x04 Stealth^x01 in this round."); return PLUGIN_HANDLED; } else { set_user_rendering(iIndex, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 7); ColorChat(iIndex, NORMAL, "you have bought^x04 Flashbang."); g_bHaveStealth[iIndex] = true; set_task(15.0, "remvoe_stealth", iIndex ); return PLUGIN_HANDLED; } } } menu_destroy( iMenu ); return PLUGIN_HANDLED; }
public remove_stealth(iIndex) { set_user_rendering(iIndex); }
Last edited by MyPc; 12-26-2011 at 02:52.
|
|