21.07.2010, 20:00
Hey guys. I just made a setcash command with dcmd>
What is wrong?:P
It always set the money to 0 :P
Probaly a dumb mistake? :P
Thankya
What is wrong?:P
It always set the money to 0 :P
pawn Код:
dcmd_setcash(playerid,params[])
{
new string[286];
new target;
target = strval(params);
new amount;
if(adminlevel[playerid]<2)
{
SendClientMessage(playerid,COLOR_GREY,"You're not allowed to use this command");
return 1;
}
if(sscanf(params,"ud",playerid,amount))
{
SendClientMessage(playerid,COLOR_RED,"*Wrong format*");
SendClientMessage(playerid,COLOR_GREY,"HINT: Type /setcash [playerid] [amount]");
return 1;
}
SetPlayerMoney(target,amount);
format(string,sizeof(string),"*You've set %s's money to $%d*",playername[target],amount);
SendClientMessage(playerid,COLOR_RED,string);
format(string,sizeof(string),"*Your money has been set to $%d by admin %s*",amount,playername[playerid]);
SendClientMessage(target,COLOR_RED,string);
return 1;
}
Thankya