31.08.2018, 00:21
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...
I have 2cp inserted, the value of x,y,z showing correct in printf:
But cp is not marking in same pos, out of world boundaries
:/ any fix please?
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;
}
PHP код:
printf("Pizza CP %i : %f,%f,%f", rand,PizzaCP[rand][piz_x],PizzaCP[rand][piz_y],PizzaCP[rand][piz_z]);
:/ any fix please?