SA-MP Forums Archive
Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem (/showthread.php?tid=438214)



Problem - Akcent_Voltaj - 19.05.2013

so I made if saving,loading look if im in interior I fall from sky..i don't know how to do look if player relogs in interior he falls when spawns..

PHP код:
SetPlayerPos(playeridPlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
                    
GetPlayerVirtualWorld(playerid);
                    
GetPlayerInterior(playerid);
                    
SetPlayerInterior(playeridGetPlayerInterior(playerid));
                    
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(playerid)); 



Re: Problem - Avi Raj - 19.05.2013

Sorry, i cant understand what you want to fix in that script?


Re: Problem - Littlehelper - 19.05.2013

Quote:
Originally Posted by Akcent_Voltaj
Посмотреть сообщение
so I made if saving,loading look if im in interior I fall from sky..i don't know how to do look if player relogs in interior he falls when spawns..

PHP код:
SetPlayerPos(playeridPlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
                    
GetPlayerVirtualWorld(playerid);
                    
GetPlayerInterior(playerid);
                    
SetPlayerInterior(playeridGetPlayerInterior(playerid));
                    
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(playerid)); 
You have to SAVE player's interior in an variable or enum when he wishes to RELOG and LOAD it back when the player rejoins.


Re: Problem - Vrag - 19.05.2013

I tested this and it works fine for me.


Re: Problem - Akcent_Voltaj - 19.05.2013

if I relog in PD with int 6 if I relog I have int 0 ..and I fall..


Re: Problem - Akcent_Voltaj - 19.05.2013

Quote:
Originally Posted by Littlehelper[MDZ]
Посмотреть сообщение
You have to SAVE player's interior in an variable or enum when he wishes to RELOG and LOAD it back when the player rejoins.
I don't know howww...plz help...


Re: Problem - Akcent_Voltaj - 19.05.2013

anyone help?


Re: Problem - Littlehelper - 19.05.2013

Okay....
pawn Код:
// you know where to place this...
new GetInterior[MAX_PLAYERS];

OnPlayerDisconnect(..) {
GetPlayerInterior(GetInterior[playerid]); // we are getting player's Interior and saving it in GetInterior variable
//code

OnPlayerSpawn(..) {
SetPlayerInterior(GetInterior[playerid]); // here we are LOADING the player's interior which is saved in the variable GetInterior
//code
Now look, you have to SAVE the variable too with what ever saving system you use like you saved your heath,cash etc and load it back on OnPlayerConnect.
This is JUST an example i'm not trying to spoon-feed.


Re: Problem - Akcent_Voltaj - 19.05.2013

can I put it at OnPlayerSpawn..or it has to be at OnPlayerConnect?


Re: Problem - Littlehelper - 19.05.2013

Quote:
Originally Posted by Akcent_Voltaj
Посмотреть сообщение
can I put it at OnPlayerSpawn..or it has to be at OnPlayerConnect?
Yes, OnPlayerSpawn it is.