An RP Scripter please help
#1

I looked at forum for help to position save when player disconnect but i cant find any that works . Can you guys help me with dini position save please !
Reply
#2

pawn Код:
dini_FloatSet(file,value,Float);
Reply
#3

I mean like the full thing, OnPlayerDisconnet, onplayerspawn and ya. im not very good to find how to save
Reply
#4

not tested, but try:

At the enum put:

Position,

after, under the register cmd, put:

pawn Код:
dini_IntSet(file,"Position", 0);
Under OnPlayerSpawn put:

pawn Код:
SetPlayerPos(playerid, dini_Int(file, "Position"));
OnPlayerDisconnect

pawn Код:
new Float:X, Float:Y, Float:Z;
dini_IntSet(file,"Position",GetPlayerPos(X, Y, Z));
I REPEAT, I didn't test and have not sure if work, but is something like this!
Reply
#5

pawn Код:
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(802) : warning 213: tag mismatch
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(802) : warning 202: number of arguments does not match definition
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(810) : warning 202: number of arguments does not match definition
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(810) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Warnings.
line 802
pawn Код:
dini_IntSet(file,"Position",GetPlayerPos(X, Y, Z));
line 810
pawn Код:
SetPlayerPos(playerid, dini_Int(file, "Position"));
Reply
#6

Accidently double click submit sorry..
Reply
#7

pawn Код:
SetPlayerPos(playerid, dini_Int(file, "PosX"), dini_Int(file, "PosY"), dini_Int(file, "PosX"));
pawn Код:
GetPlayerPos(playerid, X, Y, Z);
dini_IntSet(file,"PosX",X);
dini_IntSet(file,"PosY",Y);
dini_IntSet(file,"PosZ",Z);
Reply
#8

Top of script
pawn Код:
enum pInfo
{
    Float:pPosX,
    Float:pPosY,
    Float:pPosZ,
};
new PlayerInfo[MAX_PLAYERS][pInfo];
Saving DINI

pawn Код:
dini_FloatSet(string, "PosX", PlayerInfo[playerid][pPosX]);
dini_FloatSet(string, "PosY", PlayerInfo[playerid][pPosY]);
dini_FloatSet(string, "PosZ", PlayerInfo[playerid][pPosZ]);
Loading DINI

pawn Код:
PlayerInfo[playerid][pPosX] = dini_Float(string2,"PosX");
PlayerInfo[playerid][pPosY] = dini_Float(string2,"PosY");
PlayerInfo[playerid][pPosZ] = dini_Float(string2,"PosZ");
OnPlayerDisconnect

pawn Код:
new Float:x,Float:y,Float:z;

GetPlayerPos(playerid,x,y,z);

PlayerInfo[playerid][pPosX] = x;
PlayerInfo[playerid][pPosY] = y;
PlayerInfo[playerid][pPosZ] = z;
OnPlayerSpawn

pawn Код:
SetPlayerPos(playerid,PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ]);
Reply
#9

Lil question, where i put the saving dini and loading dini :P
Reply
#10

Quote:
Originally Posted by tanush
Посмотреть сообщение
Lil question, where i put the saving dini and loading dini :P
Read the posts.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)