Quote:
Originally Posted by Andre02
hello guys i am currently doing a code which is when an rcon Admin chat ingame [RCON ADMIN] will be behind his/her name but i am having a little problem with it, when compiling i get 1 error which is:
pawn Код:
C:\Users\xxx\Desktop\SAMP Servers\SAMP Gamemode\GM And FS\GM\NWS.pwn(690) : error 029: invalid expression, assumed zero
and here's the code
pawn Код:
public OnPlayerText(playerid, text[]) { IsPlayerAdmin(playerid); { new string[128]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof (name)); format(string, sizeof(string), "[RCON ADMIN] %s (%d): %s", name, playerid, text); SendPlayerMessageToAll(playerid, string); } else { new string2[128]; new name2[MAX_PLAYER_NAME]; GetPlayerName(playerid, name2, sizeof (name2)); format(string2, sizeof(string2), "%s (%d): %s", name2, playerid, text); SendPlayerMessageToAll(playerid, string2); } return 0; }
the line that is causing the problem is
but its something is weird because my restart command to restart the server have this else and it works correctly
here's the code
pawn Код:
CMD:restart(playerid, params[]) { if(IsPlayerAdmin(playerid)) { SendRconCommand("gmx"); } else { SendClientMessage(playerid, 0xFF6347AA, "[RCON CMD] You Need to Be Loged in as RCON Admin, to use that command"); } return 1; }
Hope you can help me Thank you.
|
The problem is actually "IsPlayerAdmin(playerid);"
You have to use "if(IsPlayerAdmin(playerid))".
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[128];
new name[MAX_PLAYER_NAME];
if(IsPlayerAdmin(playerid))
{
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "[RCON ADMIN] %s (%d): %s", name, playerid, text);
SendPlayerMessageToAll(playerid, string), string = "\0";
}
else
{
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s (%d): %s", name, playerid, text);
SendPlayerMessageToAll(playerid, string), string = "\0";
}
return 0;
}
E: Too late