04.07.2014, 14:57
@Greentarch : This one looks clearer :
The wiki says that "SendClientMessage" returns 1 if the function executes successful. This way, returning 1 just after that would be a bit useless.
@Author : Some parts of your "COMMON ERRORS" are very bad coded.
I take this code as an example :
It won't work as a solution ! You'll even get an error during the compilation !
This one would work :
Because as Zeex said :
Correct your whole tutorial please.
PHP Code:
public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )
{
return success ? 1 : SendClientMessage(playerid, -1, ">> That command doesn't exist! (/cmds)");
}
@Author : Some parts of your "COMMON ERRORS" are very bad coded.
I take this code as an example :
pawn Code:
public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )
{
if( success == 0 )
{
}
return SendClientMessage( playerid, COLOR, "Your new unknown command text" );
return 0;
}
This one would work :
pawn Code:
public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )
{
if(!success) return SendClientMessage( playerid, COLOR, "Your new unknown command text" );
return 1;
}
Because as Zeex said :
Quote:
Originally Posted by Zeex
pawn Code:
|