29.01.2012, 02:46
The script works, but when I do it, it sets whoever's id is 0.
PHP код:
command(givebadge, playerid, params[])
{
new id, badge, string[255];
if(sscanf(params, "zz", id, badge))
{
if((Player[playerid][Group] == 1 || Player[playerid][Group] == 4) && Player[playerid][GroupRank] >= 7)
{
SendClientMessage(playerid, WHITE, "SYNTAX: /givebadge [playerid] [badge]");
}
}
else
{
if((Player[playerid][Group] == 1 || Player[playerid][Group] == 4) && Player[playerid][GroupRank] >= 7)
{
Player[id][BadgeNumber] = badge;
format(string, sizeof(string), "You have given %s the badge number %s", GetName(id), badge);
SendClientMessage(playerid, WHITE, string);
format(string, sizeof(string), "%s has changed your badge number to %s", GetName(playerid), badge);
SendClientMessage(id, WHITE, string);
}
}
}