Need Some Help Please
#1

Im wanting my gamemode to auto save and load player pos and i like to have the X Y Z save to the user account file so when they reconnect they spawn where the last was, Any Ideals How My player info for xyz is pLocX pLocY pLocZ
Reply
#2

When they disconnect, get their position using "GetPlayerPos()", save it into your defined player variables. When they spawn, set them to the position as defined in their user account profile.
Reply
#3

GetPlayerPos(playerid, "LocX",PlayerInfo[pLocX]); Like this ? i hope hehe ill try
Reply
#4

Wrong. To get the players position you've to do something like this:

pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
And then save it. (If this is the way you save it)

pawn Код:
PlayerInfo[pLocX] = x;
PlayerInfo[pLocY] = y;
PlayerInfo[pLocZ] = z;
Reply
#5

Man i seriously gotta learn those errors ****** time hehe

pawn Код:
SER0~1.3\GAMEMO~1\ARS.pwn(463) : error 033: array must be indexed (variable "PlayerInfo")
SER0~1.3\GAMEMO~1\ARS.pwn(464) : error 033: array must be indexed (variable "PlayerInfo")
SER0~1.3\GAMEMO~1\ARS.pwn(465) : error 033: array must be indexed (variable "PlayerInfo")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Reply
#6

Looks like we both forgot to target who is going to get those values

Like
pawn Код:
PlayerInfo[playerid][pLocX] = x;
PlayerInfo[playerid][pLocY] = y;
PlayerInfo[playerid][pLocZ] = z;
Reply
#7

Quote:
Originally Posted by Blt950
Посмотреть сообщение
Looks like we both forgot to target who is going to get those values

Like
pawn Код:
PlayerInfo[playerid][pLocX] = x;
PlayerInfo[playerid][pLocY] = y;
PlayerInfo[playerid][pLocZ] = z;
pawn Код:
SER0~1.3\GAMEMO~1\ARS.pwn(463) : warning 213: tag mismatch
SER0~1.3\GAMEMO~1\ARS.pwn(464) : warning 213: tag mismatch
SER0~1.3\GAMEMO~1\ARS.pwn(465) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Warnings.
This might be more of assistance im sure i hope

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), ARS_SERVERFILES, name);
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    printf("The player left when he was at %f,%f,%f.", X,Y,Z);
    PlayerInfo[playerid][pLocX] = X;
    PlayerInfo[playerid][pLocY] = Y;
    PlayerInfo[playerid][pLocZ] = Z;
Reply
#8

Could Someone Please Help me this is retarded..
Reply
#9

Hello its 11pm Someone please respond I need to Know how to save player Pos
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)