Error
#2

If you used a switch, you must use "case" statements instead of if/else.

Keep in mind that you're not forced to use brackets for cases, but if you don't, you can only proceed ONE instruction. It's the same as "if" statements.

PHP код:

new bool:var;
if(var) 
SendClientMessage(playerid, -1"var is true");
else 
SendClientMessage(playerid, -1"var is false"); 
This code is right, but this one isn't :

PHP код:

new var = 188964;
if(var != 
188946) var = 188964GivePlayerMoney(playerid, var); return 1;
else var = 
0; return Kick(playerid);

// The correct code would be 

new var = 188964;

if(var != 
188964)
{
   var = 
188964;
   
GivePlayerMoney(playerid, var);
   return 
1;
}
else
{
   var = 
0;
   return 
Kick(playerid);

Modify the code below replacing "if" and "else" by "case".
Reply


Messages In This Thread
Error - by Ananisiki - 17.04.2014, 08:49
Re : Error - by S4t3K - 17.04.2014, 09:35

Forum Jump:


Users browsing this thread: 1 Guest(s)