29.11.2012, 14:08
Hi.I wanna to make command givexp.I'm using this level/exp system.Thanks
CMD:givexp(playerid, params[])
{
new id, amount, string[128];
if(sscanf(params, "ud", id, amount)) return SendClientMessage(playerid, -1, "Usage: /givexp [playerid/name] [amount]");
{
PlayerInfo[id][Exp] += amount;
format(string, sizeof(string), "XP Given: %d", amount);
SendClientMessage(id, -1, string);
}
return 1;
}
CMD:givexp(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You must be admin to use this command.");
new amount, string[128], name[24];
GetPlayerName(playerid, name, sizeof(name));
if(sscanf(params, "d", amount)) return SendClientMessage(playerid, -1, "Usage: /givexp [amount]");
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayerInfo[id][Exp] += amount;
}
format(string, sizeof(string), "Admin %s gave %d XP to all players.", name, amount);
SendClientMessageToAll(-1, string);
}
return 1;
}
if(strcmp(cmd, "/givexp", true) == 0)