22.11.2010, 17:01
Hi guys I make /givemoney cmd but when I type /givemoney it show '/givemoney playerid money' perfect but when I type /givemoney 1 it says server:unknown cmd?
Here's my coods:
Here's my coods:
pawn Код:
if (strcmp("/Givemoney", cmdtext, true, 10) == 0)
{
if (PlayerInfo[playerid][pAdminLevel] >= 4)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /GiveMoney [playerid/PartOfName] [Money]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /GiveMoney [playerid/PartOfName] [Money]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
Values = strval(tmp);
PlayerInfo[giveplayerid][pCash] += Values;
GivePlayerMoney(giveplayerid,Values);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
format(string,sizeof(string),"*Administrator %s have Give you %d Money!",sendername,Values);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string),"* Gave %d Money to %s",Values,giveplayer);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
}
return 1;
}