16.07.2010, 23:42
ok fixed. But what is wrong with this
It always says that it's setted to 0

It always says that it's setted to 0
pawn Код:
dcmd_setsapd(playerid,params[])
{
new string[286];
new giveplayerid;
giveplayerid = strval(params);
new amount;
if(adminlevel[playerid] <=4)
{
SendClientMessage(playerid,COLOR_RED,"You are not allowed to do this");
return 1;
}
if(sscanf(params,"ud",giveplayerid,sapd))
{
SendClientMessage(playerid,COLOR_RED,"USAGE:/setbank [playerid] [amount]");
return 1;
}
if(!IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid,COLOR_RED,"This player is not connected");
return 1;
}
sapd[giveplayerid] = amount;
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"Your sapd is setted to %d by %s",amount,playername);
SendClientMessage(giveplayerid,COLOR_RED,string);
GetPlayerName(giveplayerid,playername,sizeof(playername));
format(string,sizeof(string),"You have setted %s his sapd to %d",playername,amount);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}