public OnPlayerCommandText(playerid, cmdtext[])
{
// 2 LAST CMDS
if (strcmp("/restart", cmdtext, true, 10) == 0)
{
if(Player[playerid][pAdmin] >= 1)
{
SendClientMessageToAll(COLOR_YELLOW,"[SERVER]:Server is restarting be patient do not quit please");
GameTextForAll("~G~Server Restarting", 9000, 1);
SendRconCommand("gmx");
}
else
{
SendClientMessage(playerid, COLOR_RED, "[SERVER]:You are not allowed to use this command");
}
return 1;
}
if (strcmp("/desertairport", cmdtext, true, 10) == 0)
{
if(Player[playerid][pAdmin] >= 1)
{
SetPlayerPos(playerid,392.2665,2535.1682,16.5429);
SendClientMessage(playerid,COLOR_YELLOW,"[SERVER]:You teleported to Desert Airport");
}
else
{
SendClientMessage(playerid, COLOR_RED , "[SERVER]:You are not allowed to use this command");
}
return 1;
}
return 0;
}
// Is problem at end ??? Also i have no errors
//Ingame when i try to use a cmd it says unknown cmd.
(const string1[], const string2[], bool:ignorecase, length)
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
{
if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
SendClientMessageToAll(0xFFFF00AA, str);
return 1;
}
return 0;
}
if (strcmp("/restart", cmdtext, true, 10) == 0)
How to fix it
Do you mean i should script like this ?? got it on wiki PHP код:
|