PDA

View Full Version : if player Type a Command


[D]ry[D]esert
09/05/2012, 04:18 PM
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

Skaizo
09/05/2012, 04:43 PM
return 0;

change to

return 1;

sniperwars
09/05/2012, 06:30 PM
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;
}