Positions - 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)
+--- Thread: Positions (
/showthread.php?tid=280642)
Positions -
zxc1 - 02.09.2011
OnDialogResponse
pawn Код:
if(dialogid == 2021)
{
if(response)
{
new UserPath[MAX_STRING];
new Float:X,Float:Y,Float:Z;
format(UserPath,sizeof(UserPath),"Positions/%s.ini",GetName(playerid));
if(dini_Exists(UserPath))
{
X = dini_Get(UserPath,"PositionX");
Y = dini_Get(UserPath,"PositionY");
Z = dini_Get(UserPath,"PositionZ");
}
SetPlayerPos(playerid,X,Y,Z);
}
else
{
SetPlayerSpawn(playerid);
}
return 1;
}
Errors & Warnings:
Код:
error 006: must be assigned to an array
error 006: must be assigned to an array
error 006: must be assigned to an array
In this lines:
pawn Код:
X = dini_Get(UserPath,"PositionX");
Y = dini_Get(UserPath,"PositionY");
Z = dini_Get(UserPath,"PositionZ");
Re: Positions -
emokidx - 02.09.2011
just make them an array?
like
pawn Код:
new x[128], y[128], z[128];
instead of the floats
Re: Positions -
Wesley221 - 02.09.2011
It should be
pawn Код:
new Float:x[MAX_PLAYERS];, Float:y[MAX_PLAYERS], Float:z[MAX_PLAYERS];
And change all the x to x[playerid] = ...;
Re: Positions -
zxc1 - 02.09.2011
Код:
error 035: argument type mismatch (argument 2)
For this:
pawn Код:
SetPlayerPos(playerid,X,Y,Z);
Re: Positions -
[MWR]Blood - 02.09.2011
It should be
pawn Код:
SetPlayerPos(playerid,X[playerid],Y[playerid,Z[playerid]);
Re: Positions -
Jafet_Macario - 02.09.2011
pawn Код:
SetPlayerPos(playerid,X[playerid],Y[playerid],Z[playerid]);
EDIT:too late
Re: Positions -
zxc1 - 02.09.2011
I did as emokidx111 said...
Код:
error 035: argument type mismatch (argument 2)
pawn Код:
SetPlayerPos(playerid,X,Y,Z);
Re: Positions -
[MWR]Blood - 02.09.2011
Do as Wesley221 said.
Re: Positions -
FireCat - 02.09.2011
LMAO.
These are floats.
pawn Код:
X = dini_Float(UserPath,"PositionX");
Y = dini_Float(UserPath,"PositionY");
Z = dini_Float(UserPath,"PositionZ");
Or how ever it is.
Get is for strings.
Re: Positions -
Vince - 02.09.2011
Why can no-one ever identify the REAL source of the problem;
Is for strings, and strings only! Use dini_Float!
Edit: Beat me to it, lol.