05.04.2009, 16:01
Hello,
Why gives this command (when i not in the ATM) a error message :S
Why gives this command (when i not in the ATM) a error message :S
Код:
if(strcmp(cmd, "/bank", true) == 0){
if((getCheckpointType(playerid) != CP_BANK) && IsPlayerInCheckpoint(playerid)){
SendClientMessage(playerid, COLOR_RED, "* You are not in the bank (24/7 store)");
return 1;
}
tmp = strval(strtok(cmdtext, idx));
if(tmp == 0){
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bank [ammount]");
return 1;
}
if(logged[playerid] != 1){
SendClientMessage(playerid, COLOR_RED, "* You are not logged in.");
return 1;
}
if(tmp > GetPlayerMoney(playerid)){
format(string, sizeof(string), "* You dont have $%d", tmp);
SendClientMessage(playerid, COLOR_RED, string);
return 1;
}
if(tmp < 1){
format(string, sizeof(string), "* Wrong value: $%d", tmp);
SendClientMessage(playerid, COLOR_RED, string);
return 1;
}
bank[playerid] = bank[playerid] + tmp;
GivePlayerMoney(playerid, -tmp);
format(string, sizeof(string), "* You have posted $%d on you bank account, Your current balance is: $%d", tmp, bank[playerid]);
SendClientMessage(playerid, COLOR_GREEN, string);
return 1;
}


LOL