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



Little help please - bartje01 - 31.01.2011

Hey all, I want to have my pos saved when I login again.
pawn Код:
SetPlayerPos(playerid,X,Y,Z, dini_Int(file,"pos")-GetPlayerPos(playerid,X,Y,Z));
So.. my warning:
Код:
C:\Users\Michael\Desktop\Samp scvripting\gamemodes\roleplay.pwn(1254) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Not sure how to fix this.


Re: Little help please - Stigg - 31.01.2011

Is it already saving your pos on disconnect ?

Peace...


Re: Little help please - Steven Paul - 31.01.2011

you don't need - GetPlayerPos


Re: Little help please - bartje01 - 31.01.2011

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Is it already saving your pos on disconnect ?

Peace...
I did
Quote:
Originally Posted by Steven Paul
Посмотреть сообщение
you don't need - GetPlayerPos
With this
pawn Код:
SetPlayerPos(playerid,X,Y,Z, dini_Int(file,"pos"));
Still getting the same warning :[


Re: Little help please - dice7 - 31.01.2011

pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,X,Y,Z);
dini_Float(file,"posx", x);
dini_Float(file,"posy", y);
dini_Float(file,"posz", z);



Re: Little help please - bartje01 - 31.01.2011

Lol
pawn Код:
C:\Users\Michael\Desktop\Samp scvripting\gamemodes\roleplay.pwn(1423) : warning 202: number of arguments does not match definition
C:\Users\Michael\Desktop\Samp scvripting\gamemodes\roleplay.pwn(1424) : warning 202: number of arguments does not match definition
C:\Users\Michael\Desktop\Samp scvripting\gamemodes\roleplay.pwn(1425) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Warnings.
Weird... :S


Re: Little help please - JaTochNietDan - 31.01.2011

This is how you would go about saving it using dini:

pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
dini_FloatSet(file,"posx", x);
dini_FloatSet(file,"posy", y);
dini_FloatSet(file,"posz", z);
This is how you would go about reading and setting the position to it, using dini:

pawn Код:
SetPlayerPos(playerid, dini_Float(file,"posx"),dini_Float(file,"posy"),dini_Float(file,"posz"));
I recommend you try reading through the dini and Pawn documentation for more information as you seem to be seriously confused with your syntax here. In your original post you're setting the players position to...well something, then you're adding in an extra parameter that the SetPlayerPos function does not accept, and the parameter is the return value of GetPlayerPos subtracted from the return of the dini_Int function. I don't know what you were expecting to happen there, but it really makes no sense!


Re: Little help please - bartje01 - 31.01.2011

Thankyou JatochNietDan