| edward0810 |
04-14-2009 23:21 |
Scripting help about get_user_userid
Quote:
#include <amxmodx>
#include <zombieplague>
#define VERSION "1.0"
new g_buy_survivor
public plugin_init()
{
register_plugin("Comprar Survivor", VERSION, "Speed")
g_buy_survivor = zp_register_extra_item("Survivor's Ring", 50, ZP_TEAM_HUMAN)
}
public zp_extra_item_selected(player, itemid)
{
if (itemid == g_buy_survivor)
{
new userid = get_user_userid(userid)
server_cmd("amx_show_activity 0")
server_cmd("zp_survivor #%d", userid)
server_cmd("amx_show_activity 2")
set_task(1.0, "check", player)
}
}
public check(id)
{
if (!zp_get_user_survivor(id))
{
static ammo
ammo = zp_get_user_ammo_packs(id)
zp_set_user_ammo_packs(id, ammo + 50)
}
else
{
new name[32]
get_user_name(id, name, 31)
set_hudmessage(0, 255, 0, -0.05, -0.45, 1, 0.0, 5.0, 1.0, 1.0, -1)
show_hudmessage(0, "%s has worn Survivor's Ring !!!", name)
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/
|
I can compile this sma file successfully.However, in the game, after I buy this item through ZP extra item shop, server says that it can't find the player with that ID. What can I do now?:|
At last, sorry for my bad English:mrgreen:
|