15.12.2011, 20:15
Hello guys, I was,today, trying to make a /withdraw command but it doesn't seem to work as I wanted . Everytime I type /withdraw ingame it keeps telling me the Syntax (/withdraw [ammount])
pawn Код:
if(strcmp(cmd, "/withdraw", true) == 0)
{
new tmp[128], Cash;
Cash = strval(tmp);
if(strlen(tmp) == 0) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /withdraw [ammount]");
{
if(Cash > PlayerInfo[playerid][pBank]) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: Your bank account doesn't have enough funds.");
if(ItemLaptop[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: You don't have a laptop");
new string[218];
GetPlayerName(playerid,Nam,sizeof(Nam));
format(string, sizeof(string), "[E-BANK]: You have withdrawed %d$ from your Cyb3r B4nk account.", Cash);
SendClientMessage(playerid, COLOR_YELLOW, string);
PlayerInfo[playerid][pBank] = Cash;
GivePlayerMoney(playerid, Cash);
PlayerInfo[playerid][pBank] = -Cash;
}
return 1;
}