Saving players pos
#1

hey I did this tutorial:https://sampforum.blast.hk/showthread.php?tid=299791
and when i try to compile it I Get this

C:\Users\Michael C\Desktop\GTA San Andreas\gamemodes\NewRP.pwn(80) : error 017: undefined symbol "PosX"
C:\Users\Michael C\Desktop\GTA San Andreas\gamemodes\NewRP.pwn(80) : warning 215: expression has no effect
C:\Users\Michael C\Desktop\GTA San Andreas\gamemodes\NewRP.pwn(80) : error 001: expected token: ";", but found "]"
C:\Users\Michael C\Desktop\GTA San Andreas\gamemodes\NewRP.pwn(80) : error 029: invalid expression, assumed zero
C:\Users\Michael C\Desktop\GTA San Andreas\gamemodes\NewRP.pwn(80) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

I did the whole thing exactly as it told me too
Reply
#2

Show us the code where you get errors
Reply
#3

this is where line 80 is: public OnPlayerConnect(playerid)
{
PosX[ playerid ] = 0;
PosY[ playerid ] = 0;
PosZ[ playerid ] = 0;
Angle[ playerid ] = 0;
Interior[ playerid ] = 0;
VirtualWorld[ playerid ] = 0;

INI_ParseFile( user_ini_file( playerid ), "load_user_%s", .bExtra = true, .extra = playerid );
return 1;
}
Reply
#4

Put on top of your script
pawn Код:
new Float:PosX[MAX_PLAYERS], Float:PosY[MAX_PLAYERS], Float:PosZ[MAX_PLAYERS] Float:Angle[MAX_PLAYERS];
new Interior[ MAX_PLAYERS ];
new VirtualWorld[ MAX_PLAYERS];
It is said in the tutorial:
Quote:
pawn Код:
new
    Float: PosX[ MAX_PLAYERS ],
    Float: PosY[ MAX_PLAYERS ],
    Float: PosZ[ MAX_PLAYERS ],
    Float: Angle[ MAX_PLAYERS ],
    Interior[ MAX_PLAYERS ],
    VirtualWorld[ MAX_PLAYERS ]
;
Use [.pawn]YOUR CODE [./pawn] so it will be easier to read. ( without dots)
Reply
#5

i already have that, after i did the stock it compiled. but when i did the on player disconnect thats when it started saying that
Reply
#6

pawn Код:
SetPlayerPos(playerid,00,0,0);
SetPlayerFacingAngle(playerid,00);
SetPlayerInterior(playerid,0);
try it like that
Reply
#7

I don't understand. Where are errors OnPlayerConnect or/and OnPlayerDisconnect.
If it is OnPlayerConnect show me the callback.
I suggest you also to read again the tutorial. Maybe you will find your mistake.
Reply
#8

yeah i just took of the last few steps, its the onplayerdisconnect thats messing me up
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    GetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] );
    GetPlayerFacingAngle( playerid, Angle[ playerid ] );

    new INI:File = INI_Open( user_ini_file( playerid ) );
    INI_SetTag( File, "position" );
    INI_WriteFloat( File, "PositionX", PosX[ playerid ] );
    INI_WriteFloat( File, "PositionY", PosY[ playerid ] );
    INI_WriteFloat( File, "PositionZ", PosZ[ playerid ] );
    INI_WriteFloat( File, "Angle", Angle[ playerid ] );
    INI_WriteInt( File, "Interior", GetPlayerInterior( playerid ) );
    INI_WriteInt( File, "VirtualWorld", GetPlayerVirtualWorld( playerid ) );
    INI_Close( File );
    return 1;
}
Reply
#9

if you got: error 017: undefined symbol "PosX"
I really don't know what is the mistake.
The error is saying that you don't have new Posx; in your script.
You say you have? Who is crazy here lol?
Anyway, check if you miss some'{' '}'. If not, I don't know where is the problem.
Reply
#10

this sucks i did it exactly as it told me too
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)