SA-MP Forums Archive
if player Type a Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: if player Type a Command (/showthread.php?tid=341099)



if player Type a Command - [D]ry[D]esert - 09.05.2012

Hey guys
Код:
if(text[0] == '/')
    {
        new str[128];
        new playername[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
        format(str, sizeof(str), "{FFFFFF}[Commands]{00FF00} %s: %s", playername, text[1]);
        for(new i = 0; i < MAX_PLAYERS; i++)
            if(IsPlayerConnected(i) && AccountInfo[playerid][AdminLevel] >= 1)
                SendMessageToAdmins(COLOR_ORANGE, str);
        return 0;
    }
No error But does't Work IG


Re: if player Type a Command - Skaizo - 09.05.2012

pawn Код:
return 0;
change to

pawn Код:
return 1;



Re: if player Type a Command - sniperwars - 09.05.2012

pawn Код:
if(text[0] == '/')
{
     new str[128];
     new playername[MAX_PLAYER_NAME];
     GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
     format(str, sizeof(str), "{FFFFFF}[Commands]{00FF00} %s: %s", playername, text[1]);
     for(new i = 0; i < MAX_PLAYERS; i++)
     if(IsPlayerConnected(i) && AccountInfo[playerid][AdminLevel] >= 1)
     SendMessageToAdmins(COLOR_ORANGE, str);
     return 1;
}