Object no showing X cords - 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: Object no showing X cords (
/showthread.php?tid=478497)
Object no showing X cords -
JasonTurkey - 30.11.2013
Quote:
stock CreateATM(playerid, Float , Float:y, Float:z, Float:a)
{
for( new i = 0; i != MAX_ATMS; i++ )
{
if( ATMInfo[i][aCreated] == 0 )
{
new szName[24];
GetPlayerName( playerid, szName, 24 );
ATMInfo[i][aObject] = CreateObject( ATMS_OBJECT, x, y, z, 0, 0, a );
format( ATMInfo[i][aPlasedBy], 24, "%s", szName );
ATMInfo[i][aCreated] = 1;
ATMInfo[i][aX] = x;
ATMInfo[i][aY] = y;
ATMInfo[i][aZ] = z;//+1.5; // comment the +1.5 if you're not using object 980.
ATMInfo[i][aA] = a;
//SetPlayerPos( playerid, x+1, y+1, z );
new file[64];
format( file, 64, "Gates/gate_%d.ini", i );
if( !fexist( file ) )
{
dini_Create( file );
dini_IntSet( file, "Object", ATMInfo[i][aObject] );
dini_FloatSet( file, "X", ATMInfo[i][aX] );
dini_FloatSet( file, "Y", ATMInfo[i][aY] );
dini_FloatSet( file, "Z", ATMInfo[i][aZ] );
dini_FloatSet( file, "A", ATMInfo[i][aA] );
dini_Set( file, "PlacedBy", ATMInfo[i][aPlasedBy] );
}
break;
}
}
}
|
yeah when i try to make it, the object isn't there, and when I look at my scriptfiles gates/gates.ini
It shows everything
but
Object=744
X=0.000000
Y=1043.995361
Z=-1029.973022
A=32.089866
PlacedBy=Jason_Turkey
Instead of X it shows y, instead of Y it shows Z instead of Z it shows A.
PLease help
Re: Object no showing X cords -
cessil - 30.11.2013
make sure you're passing the right arguments by adding printf("x: %0.2f y: %0.2f z: %0.2f a: %0.2f",x,y,z,a);
on the first line of that stock
also might as well link you to this
https://sampforum.blast.hk/showthread.php?tid=476968
Re: Object no showing X cords -
JasonTurkey - 30.11.2013
Quote:
Originally Posted by cessil
|
Well I used the printf at my console window it still showed 0 for x
it shows the right cords just messed up one
instead of x it's y instead of y it's z.
at x = it's 0.00000
Re: Object no showing X cords -
cessil - 30.11.2013
well now you know that its not the function but whats calling the function
Re: Object no showing X cords -
JasonTurkey - 30.11.2013
Quote:
Originally Posted by cessil
well now you know that its not the function but whats calling the function
|
i sort of not get what u mean, can u explain me clearly please.
Re: Object no showing X cords -
cessil - 30.11.2013
you're passing the wrong values when you call it