22.06.2013, 03:18
Hi everyone, I got this command code in my script, how do I convert this to ZCMD? (headache)
Oh, sorry for the indentation.
Oh, sorry for the indentation.
Quote:
Код:
if(strcmp(cmd, "/deposit", true) == 0) { tmp = strtok(cmdtext, idx); if(CPS_IsPlayerInCheckpoint(playerid, cpbank)) { if(BankRecentlyUsed[playerid] == 0) { if(strlen(tmp) == 0) return SendClientMessage(playerid, ERROR, "Use: /deposit [AMOUNT]"); else { if(strval(tmp) == 0) return SendClientMessage(playerid, ERROR, "The amount must be higher than 1."); else { if(strval(tmp) > GetPlayerMoney(playerid)) return SendClientMessage(playerid, ERROR, "You do not have this amount."); else { new string[150], string2[150]; SetPlayerBankCash(playerid, GetPlayerBankCash(playerid)+strval(tmp)); SendClientMessage(playerid, GREY, "|_| Bank |_|"); format(string, sizeof(string), "Amount deposited: $%d", strval(tmp)); format(string2, sizeof(string2), "Current state: $%d", GetPlayerBankCash(playerid)); SendClientMessage(playerid, WHITE, string); SendClientMessage(playerid, WHITE, string2); GivePlayerMoney(playerid, -strval(tmp)); printf("%s (%d) deposited $%d. Location: Bank", name, playerid, strval(tmp)); return true; } } } } else if(BankRecentlyUsed[playerid] >= 1) SendClientMessage(playerid, ERROR, "You have recently robbed the Bank."); return true; } else return SendClientMessage(playerid, ERROR, "You must be on the Bank to use this command!"); } |