23.04.2015, 09:44
pawn Код:
CMD:setmoneybank(playerid,params[])
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][Level] < 5) return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
if(strval(tmp2) < 0)
{
new string[64], tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(isnull(tmp) || isnull(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, "USAGE: /setmoneybank [playerid] [amount]");
if(strval(tmp2) < 0 || strval(tmp2) > 100 && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid, red, "ERROR: Invaild amount");
new player1 = strval(tmp), moneys = strval(tmp2);
GivePlayerMoney(player1, 0-moneys);
PlayerInfo[playerid][bank] = PlayerInfo[playerid][bank]+moneys;
format(string, sizeof(string), "You have set {00FC00}%s {03E3FC}money to {00FC00}%d", pName(player1), PlayerInfo[playerid][bank]);
SendClientMessage(playerid,blue,string);
SavePlayer(playerid);
}
else { // Line 25859
new string[64], tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(isnull(tmp) || isnull(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, "USAGE: /setmoneybank [playerid] [amount]");
if(strval(tmp2) < 0 || strval(tmp2) > 100 && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: Invalid amount");
new player1 = strval(tmp), moneys = strval(tmp2);
GivePlayerMoney(player1, 0+moneys);
PlayerInfo[playerid][bank] = PlayerInfo[playerid][bank]-moneys;
format(string, sizeof(string), "You have set {00FC00}%s {03E3FC}money to {00FC00}%d", pName(player1), PlayerInfo[playerid][bank]);
SendClientMessage(playerid,blue,string);
SavePlayer(playerid);
}
}
return 1;
}