Posts: 583
Threads: 152
Joined: Sep 2013
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];
Posts: 7,185
Threads: 5
Joined: Nov 2012
Reputation:
0
ja deves ter 1 variavel com esse nome mas em uma enum ou algo do genero... ou tas a usar la com [].
Posts: 583
Threads: 152
Joined: Sep 2013
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;
}
Posts: 583
Threads: 152
Joined: Sep 2013
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
Posts: 583
Threads: 152
Joined: Sep 2013
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);
Posts: 583
Threads: 152
Joined: Sep 2013
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(playerid, PosI[playerid]);
LinkVehicleToInterior(vd, PosI[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]);
Posts: 791
Threads: 11
Joined: Dec 2014
Reputation:
0
Cara troque as variбveis de static pra new...
Posts: 583
Threads: 152
Joined: Sep 2013
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]);