C:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(5355) : warning 213: tag mismatch C:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(5355) : error 001: expected token: ")", but found "[" C:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(5355) : error 029: invalid expression, assumed zero C:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(5355) : warning 215: expression has no effect C:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(5355) : error 001: expected token: ";", but found "]" C:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(5355) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
YCMD(playerid,params[],help)
{
new Float,Float:y,Float:z,Float:angle,string[145];
if(IsPlayerInAnyVehicle(playerid))
{
GetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
GetVehicleZAngle(GetPlayerVehicleID(playerid),angl e);
for(new i;i<3;i++)
{
if(PPosition[playerid][i][SavedPosition] == 0)continue;
PPosition[playerid][i][XPos] = x;
PPosition[playerid][i][YPos] = y;
PPosition[playerid][i][ZPos] = z;
PPosition[playerid][i][PAngle] = angle;
format(string,sizeof string,"Position saved! Type /l %i to load!",i);
break;
}
SendClientMessage(playerid,0x22B998AA,string);
}
else
{
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,angle);
for(new i;i<3;i++)
{
if(PPosition[playerid][i][SavedPosition] ==0)continue;
PPosition[playerid][i][XPos] = x;
PPosition[playerid][i][YPos] = y;
PPosition[playerid][i][ZPos] = z;
PPosition[playerid][i][PAngle] = angle;
format(string,sizeof string,"Position saved! Type /l %i to load!",i);
break;
}
SendClientMessage(playerid,0x22B998AA,"Position saved! Type /l to load!");
}
PPosition[playerid][i][SavedPosition] = 1;
return 1;
}
YCMD:l(playerid,params[],help)
{
new loadnumber;
if(sscanf(params,"i",loadnumber))return SendClientMessage(playerid,-1,"/load [number]");
if(0 > loadnumber > 3)return SendClientMessage(playerid,-1,"loadnumber has to be between 0 and 3");
/*5355 */if(PPosition[playerid][loadnumber][SavedPosition] == 0) return SendClientMessage(playerid,-1,"You don't have any position saved! (/s)");
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid),PPositi on[playerid][loadnumber][XPos],PPosition[playerid][loadnumber][YPos],PPosition[playerid][loadnumber][ZPos]);
SetVehicleZAngle(GetPlayerVehicleID(playerid),PPos ition[playerid][loadnumber][PAngle]);
SendClientMessage(playerid,0x22B998AA,"Position loaded!");
}
else
{
SetPlayerPos(playerid,PPosition[playerid][loadnumber][XPos],PPosition[playerid][loadnumber][YPos],PPosition[playerid][loadnumber][ZPos]);
SetPlayerFacingAngle(playerid,PPosition[playerid][loadnumber][PAngle]);
SendClientMessage(playerid,0x22B998AA,"Position loaded!");
}
return 1;
}
Hello!
Can you show us how you declared this (SavedPosition)? - Mencent ![]() |
enum PlayerPosition { Float:XPos,//Creating the x array. In a float, because it's the x position. Float:YPos,//Creating the y array. In a float, because it's the z position. Float:ZPos,//Creating the z array. In a float, because it's the z position. Float:PAngle,//Creating the PAngle array. In a float, because it's the angle. SavedPosition//It's just a simply int array. So we can check if the player has already /s, so he won't go to 0,0,0 } new PPosition[MAX_PLAYERS][PlayerPosition];
#define MAX_LOAD_NUMBERS 3
enum PlayerPosition
{
Float:XPos,//Creating the x array. In a float, because it's the x position.
Float:YPos,//Creating the y array. In a float, because it's the z position.
Float:ZPos,//Creating the z array. In a float, because it's the z position.
Float:PAngle,//Creating the PAngle array. In a float, because it's the angle.
SavedPosition//It's just a simply int array. So we can check if the player has already /s, so he won't go to 0,0,0
}
new PPosition[MAX_PLAYERS][MAX_LOAD_NUMBERS][PlayerPosition];
You should notice the error when you read this
pawn Code:
|
C::\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(5317) : error 017: undefined symbol "x" C:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(5321) : warning 213: tag mismatch C:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(5321) : error 001: expected token: ")", but found "[" C:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(5321) : error 029: invalid expression, assumed zero C:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(5321) : warning 215: expression has no effect C:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(5321) : error 001: expected token: ";", but found "]" C:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(5321) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
PPosition[playerid][i][SavedPosition] = 1;
C:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(5352) : error 017: undefined symbol "i" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
PPosition[playerid][i][SavedPosition] = 1;
YCMD:s(playerid, params[], help)
{
new Float:x,Float:y,Float:z,Float:angle,string[145];
if(IsPlayerInAnyVehicle(playerid))
{
GetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
GetVehicleZAngle(GetPlayerVehicleID(playerid),angle);
for(new i;i<3;i++)
{
if(PPosition[playerid][i][SavedPosition] == 0)continue;
PPosition[playerid][i][XPos] = x;
PPosition[playerid][i][YPos] = y;
PPosition[playerid][i][ZPos] = z;
PPosition[playerid][i][PAngle] = angle;
format(string,sizeof string,"Position saved! Type /l %i to load!",i);
break;
}
SendClientMessage(playerid,0x22B998AA,string);
}
else
{
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,angle);
for(new i;i<3;i++)
{
if(PPosition[playerid][i][SavedPosition] ==0)continue;
PPosition[playerid][i][XPos] = x;
PPosition[playerid][i][YPos] = y;
PPosition[playerid][i][ZPos] = z;
PPosition[playerid][i][PAngle] = angle;
format(string,sizeof string,"Position saved! Type /l %i to load!",i);
break;
}
SendClientMessage(playerid,0x22B998AA,"Position saved! Type /l to load!");
}
PPosition[playerid][i][SavedPosition] = 1;
return 1;
}
C:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(5352) : error 017: undefined symbol "i" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
YCMD:s(playerid, params[], help)
{
new Float:x,Float:y,Float:z,Float:angle,string[145];
if(IsPlayerInAnyVehicle(playerid))
{
GetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
GetVehicleZAngle(GetPlayerVehicleID(playerid),angle);
}
else
{
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,angle);
}
for(new i;i<3;i++)
{
if(!PPosition[playerid][i][SavedPosition])continue;
PPosition[playerid][i][XPos] = x;
PPosition[playerid][i][YPos] = y;
PPosition[playerid][i][ZPos] = z;
PPosition[playerid][i][PAngle] = angle;
PPosition[playerid][i][SavedPosition] = 1;
break;
}
SendClientMessage(playerid,0x22B998AA,"Position saved! Type /l to load!");
return 1;
}