29.01.2011, 16:54
Full code will look like this.
I took this code from previous post.
Also be sure that you have 'ZCMD' include and sscanf include.
It is possible to define sscanf with native:
I took this code from previous post.
Also be sure that you have 'ZCMD' include and sscanf include.
It is possible to define sscanf with native:
pawn Код:
native sscanf(const data[], const format[], {Float,_}:...);
pawn Код:
CMD:givemoney(playerid, params[])
{
new
giveplayerid,
cash
;
if(sscanf(params, "ud", giveplayerid, cash))
return SendClientMessage(playerid, 0xAAAAAA, "Usage: /givemoney [playerid] [money]");
if(!IsPlayerConnected(giveplayerid)) // here
return SendClientMessage(playerid, 0xAAAAAA, "Player not connected");
if(giveplayerid == playerid)
return SendClientMessage(playerid, 0xAAAAAA, "You cannot give money to yourself");
GivePlayerMoney(giveplayerid, cash);
return 1;
}