Cp doesn't work
#1

I have a list of coordinates and by a command i want to show a dynamic cp by taking coordinates from that list:

pawn Код:
new rand = random(sizeof(PizzaDeliveryLocation));
    PizzaJobCheckpoint = CreateDynamicCP(PizzaDeliveryLocation[rand][0],PizzaDeliveryLocation[rand][1],PizzaDeliveryLocation[rand][2], 0, 0, .streamdistance = 200.0);
pawn Код:
#define PIZZA_CHECKPOINTS            24

new Float:PizzaDeliveryLocation[PIZZA_CHECKPOINTS][4] = {
{2065.9780,-1703.4775,14.1484,90.8956},
{2068.2600,-1656.4601,13.5469,86.9378},
{2068.8579,-1643.8237,13.5469,90.3844}
};
But checkpoint doesn't show. What i'm doing wrong?
Reply
#2

PHP код:
CreateDynamicCP(Float:xFloat:yFloat:zFloat:sizeworldid = -1interiorid = -1playerid = -1Float:distance 100.0); 
Reply
#3

pawn Код:
PizzaJobCheckpoint = CreateDynamicCP(PizzaDeliveryLocation[rand][0],PizzaDeliveryLocation[rand][1],PizzaDeliveryLocation[rand][2], 5, 0, 0, .streamdistance = 200.0);
Nope, doesn't work.
Reply
#4

What?
Reply
#5

PHP код:
CreateDynamicCP(Float:xFloat:yFloat:zFloat:sizeworldid = -1interiorid = -1playerid = -1Float:distance 100.0); 
Код HTML:
x = coord x
y = coord y
z = coord z
size = size of the CreateDynamicCP (5.0)
worldid = virtual world
interiorid = interiorid
playerid = ID
distance = default (100.0)
Reply
#6

Код:
sizeof(PizzaDeliveryLocation)
This will return the size of your define PIZZA_CHECKPOINTS and so it chooses a random number between 0 and 23. You only have 3 checkpoints added, so it will only work from 0 to 2.

Remove the define and PIZZA_CHECKPOINTS from the PizzaDeliveryLocation array or insert the exact amount of checkpoints.
Reply
#7

I followed both tips:

pawn Код:
new Float:PizzaDeliveryLocation[][3] = {
{2065.9780 ,-1703.4775 ,14.1484},
{2068.2600 ,-1656.4601 ,13.5469},
{2068.8579 ,-1643.8237 ,13.5469},
{2068.7437 ,-1628.9187 ,13.8762}
};
pawn Код:
PizzaJobCheckpoint = CreateDynamicCP(PizzaDeliveryLocation[rand][0],PizzaDeliveryLocation[rand][1],PizzaDeliveryLocation[rand][2], 5, 0, 0, playerid, .streamdistance = 200.0);
But nothing.
Reply
#8

Have you checked the streamdistance? You have to be near the locations for the checkpoint to be shown.
You could try to remove it.
Reply
#9

Nvm. We could continue this until tomorrow. CreateDynamicCp just shows closest checkpoint.

I "fixed" this problem by creating a map icon with square icon and red colour.

Thanks anyway.
Reply
#10

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
I followed both tips:

pawn Код:
new Float:PizzaDeliveryLocation[][3] = {
{2065.9780 ,-1703.4775 ,14.1484},
{2068.2600 ,-1656.4601 ,13.5469},
{2068.8579 ,-1643.8237 ,13.5469},
{2068.7437 ,-1628.9187 ,13.8762}
};
pawn Код:
PizzaJobCheckpoint = CreateDynamicCP(PizzaDeliveryLocation[rand][0],PizzaDeliveryLocation[rand][1],PizzaDeliveryLocation[rand][2], 5, 0, 0, playerid, .streamdistance = 200.0);
But nothing.
Try this

PHP код:
new Float:PizzaDeliveryLocation[][] =
{
{
2065.9780, -1703.477514.1484},
{
2068.2600, -1656.460113.5469},
{
2068.8579, -1643.823713.5469},
{
2068.7437, -1628.918713.8762}
}; 
PHP код:
PizzaJobCheckpoint CreateDynamicCP(PizzaDeliveryLocation[rand][0],PizzaDeliveryLocation[rand][1],PizzaDeliveryLocation[rand][2], 5.0, -1, -1, -19999999999.0); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)