Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

few errors

$
0
0
I'm currently experiencing few errors,

So when the stock is like that I have errors:

Code:

stock SendMessageToAdmins(text[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(pInfo[playerid][Admin] =< 1 (i))
        {
            SendClientMessage(i, -1, text);
        }
    }
}

but if I change this
Code:

if(pInfo[playerid][Admin]=< 1 (i))
to
Code:

if(IsPlayerAdmin(i))
I get errors
Code:

C:\Users\yan\Desktop\SA-MP Server\gamemodes\DBv1.pwn(1847) : error 017: undefined symbol "playerid"
C:\Users\yan\Desktop\SA-MP Server\gamemodes\DBv1.pwn(1847) : warning 215: expression has no effect
C:\Users\yan\Desktop\SA-MP Server\gamemodes\DBv1.pwn(1847) : error 001: expected token: ";", but found ")"
C:\Users\yan\Desktop\SA-MP Server\gamemodes\DBv1.pwn(1847) : error 029: invalid expression, assumed zero
C:\Users\yan\Desktop\SA-MP Server\gamemodes\DBv1.pwn(1847) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664                          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

Code:

CMD:report(playerid, params[])
{
    new id, reason[150];
    if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) /report [id] [reason]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) The player you're trying to report is not connected!");
        new str[150], sender[MAX_PLAYER_NAME], receiver[MAX_PLAYER_NAME];
        GetPlayerName(playerid, sender, sizeof(sender));
        GetPlayerName(id, receiver, sizeof(receiver));
        format(str, sizeof(str), "(FF0000}(REPORT) {FFFFFF}%s {FF0000}has reported {ffffff}%s {FF0000} for {FFFFFF}: %s", sender, receiver, reason);
        SendMessageToAdmins(str);
        SendClientMessage(playerid, -1, "{809fff}(INFO) Your report has been successfully sent!");
    return 1;
}
stock SendMessageToAdmins(text[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(pInfo[playerid][Admin](i))
        {
            SendClientMessage(i, -1, text);
        }
    }
}


Viewing all articles
Browse latest Browse all 18226

Trending Articles