Pick up problem - 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: Pick up problem (
/showthread.php?tid=410248)
Pick up problem -
Noles2197 - 24.01.2013
pawn Код:
CMD:pickup(playerid, params[]) // temp
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
AddStaticPickup(1582,1,x,y,z,0);
printf("AddStaticPickup(1582,1,%d,%d,%d,0);",Float:x,Float:y,Float:z);
return 1;
}
appears in the logs as..
Код:
[17:22:45] AddStaticPickup(1582,1,-990243889,1124754986,1105710588,0);
[17:23:07] AddStaticPickup(1582,1,-990177427,1124942436,1104957440,0);
How come it's giving me these and not the coordinates that I made the pickup at?
Re: Pick up problem -
ReDevilGames - 24.01.2013
Use CreatePickup, because it returns a ID
pawn Код:
CMD:pickup(playerid, params[])
{
new Float:Pos[3];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
CreatePickup(1582,1,Pos[0],Pos[1],Pos[2],0);
printf("CreatePickup(1582,1,%d,%d,%d,0);",Float:Pos[0],Float:Pos[1],Float:Pos[2]);
return 1;
}
Re: Pick up problem -
B-Matt - 24.01.2013
pawn Код:
printf("AddStaticPickup(1582,1,%d,%d,%d,0)",Float:x,Float:y,Float:z);
Re: Pick up problem -
Roach_ - 24.01.2013
Why are you using the %d placeholder when you must use %f?
pawn Код:
CMD:pickup(playerid)
{
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
CreatePickup(1582, 1, Pos[0], Pos[1], Pos[2], 0);
printf("CreatePickup(1582, 1, %f, %f, %f, 0);", Float:Pos[0], Float:Pos[1], Float:Pos[2]);
return 1;
}
Re: Pick up problem -
ReDevilGames - 26.01.2013
I was wrong, excuse me