SA-MP Forums Archive
An RP Scripter please 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: An RP Scripter please help (/showthread.php?tid=242899)



An RP Scripter please help - tanush - 20.03.2011

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 !


Re: An RP Scripter please help - Mike Garber - 20.03.2011

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



Re: An RP Scripter please help - tanush - 20.03.2011

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


Re: An RP Scripter please help - ricardo178 - 20.03.2011

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!


Re: An RP Scripter please help - tanush - 20.03.2011

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"));



Re: An RP Scripter please help - tanush - 20.03.2011

Accidently double click submit sorry..


Re: An RP Scripter please help - maramizo - 20.03.2011

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



Re: An RP Scripter please help - Hashski - 20.03.2011

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]);



Re: An RP Scripter please help - tanush - 20.03.2011

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


Re: An RP Scripter please help - maramizo - 20.03.2011

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