invalid subscript (not an array or too many subscripts): "playerid"
#1

PHP код:
 invalid subscript (not an array or too many subscripts): "playerid" 
Can someone tell me what that means, and how you fix it?
Reply
#2

Line ?
Reply
#3

Show us the code.
Reply
#4

It probably means that you have put () or [] on the end of something...
Reply
#5

I rewrote the script, and now I get warnings:
PHP код:
C:\Users\Thomas\Desktop\WickedRP.pwn(33682) : warning 217loose indentation
C
:\Users\Thomas\Desktop\WickedRP.pwn(33703) : warning 217loose indentation
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase


2 Warnings

Line:
PHP код:
if(strcmp(params,"adminhq",true) == 0)
        {
             if (
GetPlayerState(playerid) == 2)
            {
                new 
tmpcar GetPlayerVehicleID(playerid);
                
SetVehiclePos(tmpcar921.5,-3160.8,561.2);
                
LinkVehicleToInterior(tmpcar0);
                
SetVehicleVirtualWorld(tmpcar0);
                
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
            }
            else
            {
                
SetPlayerPos(playerid2227.60, -1674.8914.62);
            }
            
SendClientMessageEx(playeridCOLOR_GRAD1"Welcome to the Admin HQ");
            
SetPlayerInterior(playerid,0);
            
PlayerInfo[playerid][pInt] = 0;
            
SetPlayerVirtualWorld(playerid0);
            
PlayerInfo[playerid][pVW] = 0;
            
PlayerInfo[playerid][pLocal] = 255;
           } 
Reply
#6

pawn Код:
if(strcmp(params,"adminhq",true) == 0) {
    if (GetPlayerState(playerid) == 2) {
        new tmpcar = GetPlayerVehicleID(playerid);
        SetVehiclePos(tmpcar, 921.5,-3160.8,561.2);
        LinkVehicleToInterior(tmpcar, 0);
        SetVehicleVirtualWorld(tmpcar, 0);
        TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
    }
    else {
        SetPlayerPos(playerid, 2227.60, -1674.89, 14.62);
    }
    SendClientMessageEx(playerid, COLOR_GRAD1, "Welcome to the Admin HQ");
    SetPlayerInterior(playerid,0);
    PlayerInfo[playerid][pInt] = 0;
    SetPlayerVirtualWorld(playerid, 0);
    PlayerInfo[playerid][pVW] = 0;
    PlayerInfo[playerid][pLocal] = 255;
}
Reply
#7

NVM :S
Reply
#8

Allways make sure you keep the right space(TAB) between your lines !


Quote:

This forum requires that you wait 120 seconds between posts. Please try again in 52 seconds.

SURE ....BABE
Reply
#9

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
pawn Код:
if(strcmp(params,"adminhq",true) == 0) {
    if (GetPlayerState(playerid) == 2) {
        new tmpcar = GetPlayerVehicleID(playerid);
        SetVehiclePos(tmpcar, 921.5,-3160.8,561.2);
        LinkVehicleToInterior(tmpcar, 0);
        SetVehicleVirtualWorld(tmpcar, 0);
        TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
    }
    else {
        SetPlayerPos(playerid, 2227.60, -1674.89, 14.62);
    }
    SendClientMessageEx(playerid, COLOR_GRAD1, "Welcome to the Admin HQ");
    SetPlayerInterior(playerid,0);
    PlayerInfo[playerid][pInt] = 0;
    SetPlayerVirtualWorld(playerid, 0);
    PlayerInfo[playerid][pVW] = 0;
    PlayerInfo[playerid][pLocal] = 255;
}
The warnings are still there.
Reply
#10

God! Ofc it will still there. If you code is like this
pawn Код:
// OnPlayerCommandtext
     if(strcmp(params,"adminhq",true) == 0) {
         if (GetPlayerState(playerid) == 2) {
            new tmpcar = GetPlayerVehicleID(playerid);
            SetVehiclePos(tmpcar, 921.5,-3160.8,561.2);
            LinkVehicleToInterior(tmpcar, 0);
            SetVehicleVirtualWorld(tmpcar, 0);
            TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
        }
        else {
            SetPlayerPos(playerid, 2227.60, -1674.89, 14.62);
        }
        SendClientMessageEx(playerid, COLOR_GRAD1, "Welcome to the Admin HQ");
        SetPlayerInterior(playerid,0);
        PlayerInfo[playerid][pInt] = 0;
        SetPlayerVirtualWorld(playerid, 0);
        PlayerInfo[playerid][pVW] = 0;
        PlayerInfo[playerid][pLocal] = 255;
}
// For example this is another command
if(strcmp(params,"adminhq",true) == 0) {
    if (GetPlayerState(playerid) == 2) {
        new tmpcar = GetPlayerVehicleID(playerid);
        SetVehiclePos(tmpcar, 921.5,-3160.8,561.2);
        LinkVehicleToInterior(tmpcar, 0);
        SetVehicleVirtualWorld(tmpcar, 0);
        TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
    }
    else {
        SetPlayerPos(playerid, 2227.60, -1674.89, 14.62);
    }
    SendClientMessageEx(playerid, COLOR_GRAD1, "Welcome to the Admin HQ");
    SetPlayerInterior(playerid,0);
    PlayerInfo[playerid][pInt] = 0;
    SetPlayerVirtualWorld(playerid, 0);
    PlayerInfo[playerid][pVW] = 0;
    PlayerInfo[playerid][pLocal] = 255;
    return 1;
}
return 0;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)