Wrong TP - 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: Wrong TP (
/showthread.php?tid=658271)
Wrong TP -
akib - 31.08.2018
I am trying to make pizza boy job so when someone do /getpizza, they will get random checkpoint marked on minimap, checkpoints are mysql base - a cmd exist to create it...
PHP код:
COMMAND:getpizza(playerid,params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 2, 1979.3885,913.7875,11.0391)) return SendClientMessage(playerid, -1, "Error : You are not at stacks.");
new rand = random(sizeof(TotalPC));
SetPlayerCheckpoint(playerid, PizzaCP[rand][piz_x], PizzaCP[rand][piz_y], PizzaCP[rand][piz_z], 10);
PizzaBoy[playerid][CarryingPizza] = 1;
SendClientMessage(playerid, -1, "Pizza Stacks gave you a tray, deliver it to destination.");
printf("Pizza CP %i : %f,%f,%f", rand,PizzaCP[rand][piz_x],PizzaCP[rand][piz_y],PizzaCP[rand][piz_z]);
SetPlayerPos(playerid, PizzaCP[rand][piz_x],PizzaCP[rand][piz_y],PizzaCP[rand][piz_z]);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
return 1;
}
I have 2cp inserted, the value of x,y,z showing correct in printf:
PHP код:
printf("Pizza CP %i : %f,%f,%f", rand,PizzaCP[rand][piz_x],PizzaCP[rand][piz_y],PizzaCP[rand][piz_z]);
But cp is not marking in same pos, out of world boundaries
:/ any fix please?
Re: Wrong TP -
solstice_ - 31.08.2018
PHP код:
SetPlayerPos(playerid, PizzaCP[rand][0], PizzaCP[rand][1], PizzaCP[rand][2]);
SetPlayerFacingAngle(playerid, PizzaCP[rand][3]);
If this doesn't work post the code where you store random spawns.