Pawn Error
#1

I got this error while complieing my script
pawn Код:
C:\Users\Daoud\Desktop\Grand theft Auto San Andreas + Samp\Pilots heaven\gamemodes\PH.pwn(20955) : error 017: undefined symbol "PlayerInfo"
C:\Users\Daoud\Desktop\Grand theft Auto San Andreas + Samp\Pilots heaven\gamemodes\PH.pwn(20955) : warning 215: expression has no effect
C:\Users\Daoud\Desktop\Grand theft Auto San Andreas + Samp\Pilots heaven\gamemodes\PH.pwn(20955) : error 001: expected token: ";", but found "]"
C:\Users\Daoud\Desktop\Grand theft Auto San Andreas + Samp\Pilots heaven\gamemodes\PH.pwn(20955) : error 029: invalid expression, assumed zero
C:\Users\Daoud\Desktop\Grand theft Auto San Andreas + Samp\Pilots heaven\gamemodes\PH.pwn(20955) : 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.
Here is what i added
pawn Код:
if(strcmp(cmd, "/jail", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /jail [playerid/PartOfName] [minutes] [reason]");
                return 1;
            }
            new playa;
            new time;
            playa = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            time = strvalEx(tmp);
            if(PlayerInfo[playerid][pAdmin] >= 2)
            {
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        new length = strlen(cmdtext);
                        while ((idx < length) && (cmdtext[idx] <= ' '))
                        {
                            idx++;
                        }
                        new offset = idx;
                        new result[64];
                        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                        {
                            result[idx - offset] = cmdtext[idx];
                            idx++;
                        }
                        result[idx - offset] = EOS;
                        if(!strlen(result))
                        {
                            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /jail [playerid/PartOfName] [minutes] [reason]");
                            return 1;
                        }
                        format(string, sizeof(string), "{AA3333}Admin Cmd{FFFF00}: %s has been jailed by an Admin, reason: %s", giveplayer, (result));
                        SendClientMessageToAll(COLOR_LIGHTRED, string);
                        ClearGuns(playa);
                        ResetPlayerWeapons(playa);
                        PlayerInfo[playa][pWantedLevel] = 0;
                        SetPlayerWantedLevel(playa, 0);
                        SetPlayerToTeamColor(playa);
                        PlayerInfo[playa][pJailed] = 1;
                        PlayerInfo[playa][pJailTime] = time*60;
                        SetPlayerInterior(playa, 6);
                        SetPlayerVirtualWorld(playerid, 0);
                        PlayerInfo[giveplayerid][pVirtualWorld] = 0;
                        SetPlayerPos(playa, 264.6288,77.5742,1001.0391);
                        SetPlayerFacingAngle(playa, -90);
                        format(string, sizeof(string), "You are jailed for %d minutes.   Bail: Unable", time);
                        SendClientMessage(playa, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   You are not a Admin!");
            }
        }
        return 1;
    }
Reply
#2

The error says, you don't have PlayerInfo defined. Do you use pInfo or what ? As you have to set it to be like the one you use in the whole script.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)