SA-MP Forums Archive
[Scripting Help] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Scripting Help] (/showthread.php?tid=150038)



[Scripting Help] - Visualbr - 24.05.2010

I'm trying to create a little script, that will teleport a person back to his last position after a crash.
Quote:

#include <file.inc>
#include <a_npc>
#include <a_samp>


public OnPlayerDisconnect(playerid)
{
//Save the players location so we can spawn him there again on connect.
new Float, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);

printf("The player left when he was at %f,%f,%f.", x, y, z);

return 1;
}
Saying players last position. Now I have to move them into a file that will later be readed and the person will be spawned and the crash point. Same position... Need a way to continue that.


Re: [Scripting Help] - aircombat - 24.05.2010

Use Dini (Saving System)


Re: [Scripting Help] - Visualbr - 24.05.2010

Could you please explain?


Re: [Scripting Help] - DJDhan - 24.05.2010

>>>>>DINI by Draco Blue<<<<<


Re: [Scripting Help] - Visualbr - 24.05.2010

Quote:

/This is a crash script for LoRP.


#include <a_samp>
#include <zcmdsscanf>


public OnPlayerDisconnect(playerid,reason)

SavePlayer(playerid)
{
if(IsLogged[playerid] == 1)
{
dini_IntSet(file, "Position", GetPlayerPos(playerid));
IsLogged[playerid] = 0;
}
return 1;
}




Re: [Scripting Help] - ViruZZzZ_ChiLLL - 24.05.2010

Quote:
Originally Posted by Visualbr
Quote:

/This is a crash script for LoRP.


#include <a_samp>
#include <zcmdsscanf>


public OnPlayerDisconnect(playerid,reason)

SavePlayer(playerid)
{
if(IsLogged[playerid] == 1)
{
dini_IntSet(file, "Position", GetPlayerPos(playerid));
IsLogged[playerid] = 0;
}
return 1;
}

Wait, what :O Why is it #include <zcmdsscanf>
is should be separated

pawn Код:
#include<zcmd>
#include<sscanf>



Re: [Scripting Help] - Visualbr - 24.05.2010

Quote:

//This is a crash script for LoRP.

#include <a_samp>
#include <zcmd>
#include <sscanf>

public OnPlayerDisconnect(playerid, reason)

SavePlayer(playerid)
{
if(IsLogged[playerid] == 1)
{
dini_IntSet(file, "playercrash", GetPlayerPos(playerid));
IsLogged[playerid] = 0;
}
return 1;
}

public OnPlayerSpawn(playerid)

SetPlayerPos()

Alright.