1 error
#3

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

pawn Код:
{
else // this one
}
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
Reply


Messages In This Thread
1 error - by Andre02 - 21.08.2014, 14:46
Re: 1 error - by MicroD - 21.08.2014, 14:49
Re: 1 error - by Kyance - 21.08.2014, 14:50
Re : 1 error - by Andre02 - 21.08.2014, 14:56
Re : 1 error - by Andre02 - 21.08.2014, 15:11
Re : 1 error - by Andre02 - 21.08.2014, 17:56
Re: 1 error - by silenthill - 21.08.2014, 18:26
Re : Re: 1 error - by Andre02 - 25.08.2014, 03:45

Forum Jump:


Users browsing this thread: 1 Guest(s)