Raised This Month: $ Target: $400
 0% 

Scripting help about get_user_userid


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edward0810
Member
Join Date: Mar 2009
Location: H.K.
Old 04-14-2009 , 23:21   Scripting help about get_user_userid
Reply With Quote #1

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
edward0810 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-14-2009 , 23:56   Re: Scripting help about get_user_userid
Reply With Quote #2

Code:
new userid = get_user_userid(userid)


Code:
new userid = get_user_userid(player)
__________________
fysiks is offline
edward0810
Member
Join Date: Mar 2009
Location: H.K.
Old 04-15-2009 , 00:22   Re: Scripting help about get_user_userid
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
Code:
new userid = get_user_userid(userid)


Code:
new userid = get_user_userid(player)
thanks a lot!
My plugin now works correctly!
edward0810 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode