[Ajuda] erro bizarro [ajudem pfv]
#1

estou com este erro com o comandos /sp e /irp ja procurei na net a soluзгo e eu fiz e enxe mais ainda de erro oque sera?

erro: error 028: invalid subscript (not an array or too many subscripts): "PosX"


LINHA

pawn Код:
static Float:Pos[5];

static Float:PosX;
static Float:PosY;
static Float:PosZ;
static Float:PosI;
static Float:PosA[MAX_PLAYERS];
Reply
#2

ja deves ter 1 variavel com esse nome mas em uma enum ou algo do genero... ou tas a usar la com [].
Reply
#3

Quote:
Originally Posted by PT
Посмотреть сообщение
ja deves ter 1 variavel com esse nome mas em uma enum ou algo do genero... ou tas a usar la com [].
meu comando ta assim:

pawn Код:
command(sp, playerid, params[])
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
    {

        GetVehicleZAngle(GetPlayerVehicleID(playerid), PosA[playerid]);
        GetVehiclePos(GetPlayerVehicleID(playerid), PosX[playerid], PosY[playerid], PosZ[playerid]);
    }
    else if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
    {


        GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
        GetPlayerFacingAngle(playerid, PosA[playerid]);
    }
    PosI[playerid] = (GetPlayerInterior(playerid));
    SendClientMessage(playerid, Cinza, "[ > ] Posiзгo Salva com Sucesso!");
    return 1;
}

command(irp, playerid, params[])
{
    if (!floatsqroot(PosX[playerid]+PosY[playerid]+PosZ[playerid])) return SendClientMessage(playerid, Vermelho, "[ x ] Salve a posiзгo primeiro. /Sp");
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {


        new vd = GetPlayerVehicleID(playerid);
        SetVehiclePos(vd, PosA[playerid],[playerid], PosY[playerid], PosZ[playerid]);
        SetVehicleZAngle(vd, PosA[playerid]);
        PutPlayerInVehicle(playerid, vd, 0);
        LinkVehicleToInterior(vd, PosI[playerid]);
        SetCameraBehindPlayer(playerid);
    }else{
        SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
        SetPlayerInterior(playerid, PosI);
        SetPlayerFacingAngle(playerid, PosA[playerid]);
        SetCameraBehindPlayer(playerid);
    }
    SendClientMessage(playerid, Cinza, "[ > ] Posiзгo Carregada com Sucesso!");
    return 1;
}
Reply
#4

PHP код:
static Float:PosX[MAX_PLAYERS];
static 
Float:PosY[MAX_PLAYERS];
static 
Float:PosZ[MAX_PLAYERS];
static 
Float:PosI[MAX_PLAYERS];
static 
Float:PosA[MAX_PLAYERS]; 
anyway deverias usar new em vez de static
Reply
#5

Quote:
Originally Posted by PT
Посмотреть сообщение
PHP код:
static Float:PosX[MAX_PLAYERS];
static 
Float:PosY[MAX_PLAYERS];
static 
Float:PosZ[MAX_PLAYERS];
static 
Float:PosI[MAX_PLAYERS];
static 
Float:PosA[MAX_PLAYERS]; 
anyway deverias usar new em vez de static
coloquei o de cima deu isso aqui:

pawn Код:
C:\Servidor\Servidor\gamemodes\GM.pwn(4517) : error 035: argument type mismatch (argument 2)
C:\Servidor\Servidor\gamemodes\GM.pwn(4518) : error 035: argument type mismatch (argument 2)
C:\Servidor\Servidor\gamemodes\GM.pwn(4522) : error 035: argument type mismatch (argument 2)
C:\Servidor\Servidor\gamemodes\GM.pwn(4558) : error 035: argument type mismatch (argument 2)
C:\Servidor\Servidor\gamemodes\GM.pwn(4559) : error 033: array must be indexed (variable "PosX")
C:\Servidor\Servidor\gamemodes\GM.pwn(4563) : error 035: argument type mismatch (argument 2)
C:\Servidor\Servidor\gamemodes\GM.pwn(5155) : warning 217: loose indentation
C:\Servidor\Servidor\gamemodes\GM.pwn(5170) : error 029: invalid expression, assumed zero
C:\Servidor\Servidor\gamemodes\GM.pwn(5170) : warning 215: expression has no effect
C:\Servidor\Servidor\gamemodes\GM.pwn(5170) : error 001: expected token: ";", but found "]"
C:\Servidor\Servidor\gamemodes\GM.pwn(5170) : error 029: invalid expression, assumed zero
C:\Servidor\Servidor\gamemodes\GM.pwn(5170) : fatal error 107: too many error messages on one line
Reply
#6

arrumei o resto agora deu isso!!
pawn Код:
C:\Servidor\Servidor\gamemodes\GM.pwn(5167) : warning 213: tag mismatch
C:\Servidor\Servidor\gamemodes\GM.pwn(5171) : warning 213: tag mismatch
LINHAS:
pawn Код:
SetPlayerInterior(playerid, PosI);
LinkVehicleToInterior(vd, PosI);
Reply
#7

Quote:
Originally Posted by best95
Посмотреть сообщение
arrumei o resto agora deu isso!!
pawn Код:
C:\Servidor\Servidor\gamemodes\GM.pwn(5167) : warning 213: tag mismatch
C:\Servidor\Servidor\gamemodes\GM.pwn(5171) : warning 213: tag mismatch
LINHAS:
pawn Код:
SetPlayerInterior(playerid, PosI);
LinkVehicleToInterior(vd, PosI);
Se sua variбvel PosI estб com MAX_PLAYERS vocк deve usar playerid dps do nome da funзгo, ficando assim:

PHP код:
SetPlayerInterior(playeridPosI[playerid]);
LinkVehicleToInterior(vdPosI[playerid]); 
Reply
#8

Quote:
Originally Posted by LockedLucas
Посмотреть сообщение
Se sua variбvel PosI estб com MAX_PLAYERS vocк deve usar playerid dps do nome da funзгo, ficando assim:

PHP код:
SetPlayerInterior(playeridPosI[playerid]);
LinkVehicleToInterior(vdPosI[playerid]); 
colocando do geito que voce me passou da esses erros!!


pawn Код:
C:\Servidor\Servidor\gamemodes\GM.pwn(5167) : error 028: invalid subscript (not an array or too many subscripts): "PosI"
C:\Servidor\Servidor\gamemodes\GM.pwn(5167) : warning 215: expression has no effect
C:\Servidor\Servidor\gamemodes\GM.pwn(5167) : error 001: expected token: ";", but found "]"
C:\Servidor\Servidor\gamemodes\GM.pwn(5167) : error 029: invalid expression, assumed zero
C:\Servidor\Servidor\gamemodes\GM.pwn(5167) : fatal error 107: too many error messages on one line
LINHA:

pawn Код:
LinkVehicleToInterior(vd, PosI[playerid]);
Reply
#9

Cara troque as variбveis de static pra new...
Reply
#10

Quote:
Originally Posted by LockedLucas
Посмотреть сообщение
Cara troque as variбveis de static pra new...
fiz isso olha ai continua!!

pawn Код:
C:\Servidor\Servidor\gamemodes\GM.pwn(5167) : warning 213: tag mismatch
C:\Servidor\Servidor\gamemodes\GM.pwn(5171) : warning 213: tag mismatch
pawn Код:
new Float:PosI[MAX_PLAYERS];

LINHAS:

pawn Код:
LinkVehicleToInterior(vd, PosI[playerid]);
SetPlayerInterior(playerid, PosI[playerid]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)