01.03.2012, 15:03
Quote:
Hey guys,
i'm actually making my own gamemode and i don't know why but when i type a commande it does nothing Example : Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/test", cmdtext, true, 10) == 0) { SendClientMessage(playerid, COLOR_LIGHTRED, "Test OK"); // Do something here return 1; } return 0; } Thanks for your help |
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/help", true))
{
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: This is the /help command!");
return 1;
// Returning 1 informs the server that the command has been processed.
// OnPlayerCommandText won't be called in other scripts.
}
return 0;
// Returning 0 informs the server that the command hasn't been processed by this script.
// OnPlayerCommandText will be called in other scripts until one returns 1.
// If no scripts return 1, the 'SERVER: Unknown Command' message will be shown.
}
I hope this helps.
-FalconX