SA-MP Forums Archive
Pickup doesn't create - 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: Pickup doesn't create (/showthread.php?tid=437559)



Pickup doesn't create - JaKe Elite - 16.05.2013

pawn Код:
enum Horses
{
    Float:hx,
    Float:hy,
    Float:hz,
    order
}
new hcord[][Horses] =
{
    {2323.7659,1283.2438,97.5738,1},
    {1432.0463,2751.2932,19.5234,2},
    {-144.1049,1231.6788,26.2031,3},
    {-688.2123,938.3978,13.6328,4},
    {-1531.5845,687.4770,133.0514,5}
};

//OnFilterScriptInit
horse[0] = CreatePickup(954, 1, 2011.8767,1544.7483,9.4787, 0);
for(new x = 0; x < sizeof(hcord); x++)
{
    horse[hcord[x][order]] = CreatePickup(954, 1, hcord[x][hx], hcord[x][hy], hcord[x][hy], 0);
}
But it doesn't create the pickup.
The pickup 0 is exceptional because as you can see i code that manually.


Re: Pickup doesn't create - Emmet_ - 16.05.2013

Here's your problem:

pawn Код:
for(new x = 0; x < sizeof(hcord); x++)
{
    horse[hcord[x][order]] = CreatePickup(954, 1, hcord[x][hx], hcord[x][hy], hcord[x][hy], 0);
}
That code works, except that you are creating the pickup at:

X: hcord[x][hx]
Y: hcord[x][hy]
Z: hcord[x][hy] - Should be hz

Try this:

pawn Код:
for(new x = 0; x < sizeof(hcord); x++)
{
    horse[hcord[x][order]] = CreatePickup(954, 1, hcord[x][hx], hcord[x][hy], hcord[x][hz], 0);
}



Re: Pickup doesn't create - RajatPawar - 16.05.2013

CTRL + C and CTRL + V can be dangerous!