I want to know if is possible to edit the sj.sma and make a command in chat to give someone your xp.For example: Me (Spy) i want to give John 50 xp..I type in chat: /givexp john 50 ,and if i don't have 50 xp, print me in chat: "You don't have enough xp, to donate!"
This is what I found:
PHP Code:
#include <amxmisc>
register_concmd("amx_givexp", "concmd_GiveXP", ADMIN_LEVEL_A, "<nick, #userid, authid> <xp to give>");
public concmd_GiveXP(id, level, cid)
{
if(!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;
new arg[35];
read_argv(1, arg, 34);
new player = cmd_target(id, arg, 3);
if(!player)
return PLUGIN_HANDLED;
read_argv(2, arg, 15);
new xp = str_to_num(arg);
if(xp > g_Experience[player])
xp = g_Experience[player];
g_Experience[player] += xp;
new nameA[32], nameP[32];
get_user_name(id, nameA, 31);
get_user_name(player, nameP, 31);
client_print(0, print_chat, "ADMIN %s: gave %d XP to %s!", nameA, xp, nameP);
new authidA[32], authidP[32];
get_user_authid(id, authidA, 31);
get_user_authid(id, authidP, 31);
log_amx("%s <%s> gave %d XP to %s <%s>", nameA, authidA, xp, nameP, authidP);
return PLUGIN_HANDLED;
}
But I don;t want 4 admins, i want for all people who play. Can someone edit this 4 me? I tried but...nothing.
Sry 4 my bad english (I'm from Romania)!
P.S: Here I hound that code:
http://forums.alliedmods.net/showthread.php?t=67162
And here it's the .sma: