Commands says wrong command, (return 0;)
#1

Hello,

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;
  }
Reply


Messages In This Thread
Commands says wrong command, (return 0;) - by kevinsoftware - 05.04.2009, 16:01
Re: Commands says wrong command, (return 0;) - by Burridge - 05.04.2009, 16:08
Re: Commands says wrong command, (return 0;) - by kevinsoftware - 05.04.2009, 16:46
Re: Commands says wrong command, (return 0;) - by Bardokas - 05.04.2009, 17:39

Forum Jump:


Users browsing this thread: 1 Guest(s)