Logging to Avoid Auto Jail ( Need Help)
#1

So I've recently wanted to put a system in which if a player disconnected while he was cuffed or tied, he would be jailed. I tried doing it myself and got a load of errors, from an open bracket somewhere. Please help me if you see what's wrong.

pawn Код:
if (GetPVarInt(playerid, "PlayerCuffed") || (GetPVarInt(playerid, "PlayerTied"))
        {
            GetPlayerName(playerid);
            format(string, sizeof(string), "AdmCmd: %s was auto-jailed by the Server, reason: Logging to Avoid.", PlayerName(userid, false));
            SendClientMessageToAll(LIGHTRED, string);
            SendClientMessage(playerid, LIGHTRED, string);
            PlayerEnum[userid][pJailed] = 2;
           
        if (!(minutes == 0)) PlayerEnum[userid][pJailTime] = minutes * 60;
            else PlayerEnum[userid][pJailTime] = 1;
            SetPlayerPos(userid, 264.6288, 77.5742, 1001.0391);
            SetPlayerInterior(userid, 6);
            SetPlayerVirtualWorld(userid, 999999);
            ClearWeapons(userid);

        if (minutes > 0)
        {
            PlayerEnum[playerid][pJailedPlayers]++;
            PlayerEnum[userid][pJailCount]++;
            }
    }
 return 1;
}
Errors:

pawn Код:
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3504) : error 028: invalid subscript (not an array or too many subscripts): "GetPVarInt"
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3505) : warning 202: number of arguments does not match definition
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3505) : warning 202: number of arguments does not match definition
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3506) : warning 217: loose indentation
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3506) : error 017: undefined symbol "userid"
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3509) : error 017: undefined symbol "userid"
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3511) : warning 217: loose indentation
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3511) : error 017: undefined symbol "minutes"
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3511) : error 017: undefined symbol "userid"
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3512) : error 017: undefined symbol "userid"
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3513) : warning 217: loose indentation
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3513) : error 017: undefined symbol "userid"
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3514) : error 017: undefined symbol "userid"
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3515) : error 017: undefined symbol "userid"
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3516) : error 017: undefined symbol "userid"
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3518) : warning 217: loose indentation
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3518) : error 017: undefined symbol "minutes"
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3521) : error 017: undefined symbol "userid"
C:\Users\Jesse\Desktop\NWRP\gamemodes\roleplay.pwn(3524) : warning 217: loose indentation
Edit: I fixed a bracket, now I've received these errors, help if you can. Code has been updated.
Reply
#2

Try changing all the "userid" to "playerid"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)