14.01.2013, 00:42
Try this instead of what you got going there. Although it looks like you'll have to convert the code there o.O
I didn't see that, i just gave you the /cookie commad outta my script XD
I didn't see that, i just gave you the /cookie commad outta my script XD
Код:
CMD:cookie(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new playa,amount;
if(!sscanf(params, "ui", playa, amount))
{
if(IsPlayerConnected(playa))
{
if(playa == playerid && PlayerInfo[playerid][pAdmin] < 9999)
{
SendClientMessage(playerid, COLOR_LIGHTRED, " You can't award cookies to yourself!");
return 1;
}
PlayerInfo[playa][pCookies] += amount;
new string[128];
format(string, sizeof(string), "* Admin %s awared you with %d cookies.", PlayerNameEx(playerid), amount);
SendClientMessage(playa, COLOR_ORANGE, string);
format(string, sizeof(string), "* You awarded %s with %d cookies.", PlayerNameEx(playa), amount);
SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
format(string, sizeof(string), "AdmCmd: %s awarded %d cookie(s) to %s!", PlayerNameEx(playerid), amount, PlayerNameEx(playa));
BroadCast(COLOR_GREENISHGOLD, string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, " Invalid player!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /Cookie [playerid/PartOfName] [Amount]");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Gives the player an RP cookie.(Negative amounts possible)");
}
}
return 1;
}

