[Scripting Help]
#1

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.
Reply
#2

Use Dini (Saving System)
Reply
#3

Could you please explain?
Reply
#4

>>>>>DINI by Draco Blue<<<<<
Reply
#5

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;
}

Reply
#6

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>
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)