How to spawn player on position player was in this ?
#1

when leave game, how to get player pos and when player connect, player spawn with this position ?
help meeeee
Reply
#2

Get a saving system and save the coordinates of the player when it disconnects. And when the player rejoins then load the position from the file and set the position.

Some frequently used saving systems are:
1. MySQL
2. SQLite
3. Y_INI
4. DINI
etc.
Reply
#3

Make Enums for the player for example

oldX,
oldY,
oldZ,

and put under OnPlayerDisconnect

Quote:

GetPlayerPos(PlayerInfo[playerid][oldX], PlayerInfo[playerid][oldY], PlayerInfo[playerid][oldZ]);

and make sure that you save these enums in the player's .ini if u are using DINI or YINI or save it in the player's table if you're using MySQL..

Then go ahead under OnPlayerConnect and put under it
Quote:

SetPlayerPos(PlayerInfo[playerid][oldX], PlayerInfo[playerid][oldY], PlayerInfo[playerid][oldZ]);

and we are done..
Reply
#4

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
Make Enums for the player for example

oldX,
oldY,
oldZ,

and put under OnPlayerDisconnect



and make sure that you save these enums in the player's .ini if u are using DINI or YINI or save it in the player's table if you're using MySQL..

Then go ahead under OnPlayerConnect and put under it
and we are done..
C:\Users\Karato\Downloads\San Andreas File-X-Survival\filterscripts\Login.pwn(830) : warning 213: tag mismatch
C:\Users\Karato\Downloads\San Andreas File-X-Survival\filterscripts\Login.pwn(830) : warning 213: tag mismatch
C:\Users\Karato\Downloads\San Andreas File-X-Survival\filterscripts\Login.pwn(830) : warning 202: number of arguments does not match definition
C:\Users\Karato\Downloads\San Andreas File-X-Survival\filterscripts\Login.pwn(880) : warning 202: number of arguments does not match definition
Reply
#5

and should I imagine what the error lines are? Show me the lines of these errors..
Reply
#6

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
and should I imagine what the error lines are? Show me the lines of these errors..
like this
Reply
#7

the lines itself which showed these errors, Lines : 830 and 880
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)