4 Erros
#1

Code:
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.
PHP Code:
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(
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;

Reply
#2

Hello!

Can you show us how you declared this (SavedPosition)?

- Mencent
Reply
#3

Quote:
Originally Posted by Mencent
View Post
Hello!

Can you show us how you declared this (SavedPosition)?

- Mencent
Code:
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];
Reply
#4

You should notice the error when you read this
pawn Code:
#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];
Make sure you never load a "load number" after 3, otherwise increase "MAX_LOAD_NUMBERS"
Reply
#5

Quote:
Originally Posted by xVIP3Rx
View Post
You should notice the error when you read this
pawn Code:
#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];
Make sure you never load a "load number" after 3, otherwise increase "MAX_LOAD_NUMBERS"
I Got this
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.
Reply
#6

You must understand enums

if you don't want to, show me the new error lines..
Reply
#7

how to fix THis Now
pawn Code:
PPosition[playerid][i][SavedPosition] = 1;
Code:
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.
Reply
#8

Don't show us a line, show me the whole function/command and point the line out..

this errors says that the compiler doesn't know what "i" is, you didn't declare it.
Reply
#9

pawn Code:
PPosition[playerid][i][SavedPosition] = 1;
PHP Code:
YCMD:s(playeridparams[], 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;

Code:
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.
[/QUOTE]
Reply
#10

Put it inside the loop
pawn Code:
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;
}
EDITED few seconds after posting.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)