SA-MP Forums Archive
CreateDynamicRaceCP help. - 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: CreateDynamicRaceCP help. (/showthread.php?tid=524579)



CreateDynamicRaceCP help. - tuuler - 07.07.2014

----


Respuesta: CreateDynamicRaceCP help. - Siralos - 07.07.2014

Can you paste your 'onplayerenterdynamiccp' code?


Re: Respuesta: CreateDynamicRaceCP help. - tuuler - 07.07.2014

Quote:
Originally Posted by Siralos
Посмотреть сообщение
Can you paste your 'onplayerenterdynamiccp' code?
Why would you need that if I am using CreateDynamicRaceCP? Everything what you need is here.


Respuesta: CreateDynamicRaceCP help. - Siralos - 07.07.2014

I only see the code where the checkpoint changes from "1" to "2", but not the rest until "19".
And also paste the creation of the first CP.


Re: Respuesta: CreateDynamicRaceCP help. - tuuler - 07.07.2014

Quote:
Originally Posted by Siralos
Посмотреть сообщение
I only see the code where the checkpoint changes from "1" to "2", but not the rest until "19".
And also paste the creation of the first CP.
Everything goes exactly the same until the ending...

Creation of the first cp:
pawn Код:
SandkingCP[playerid][1] = CreateDynamicRaceCP(0, 333.7576,1152.8257,8.7779, 383.1623,1177.8622,8.3247, 5.0, -1, -1, playerid, 2000.0);



Respuesta: CreateDynamicRaceCP help. - Siralos - 07.07.2014

Just to make sure, can you put a 'return' after every line of checkpoint creation?
SandkingCP[playerid][2] = CreateDynamicRaceCP(0, 383.1623,...

return 0;


Re: Respuesta: CreateDynamicRaceCP help. - tuuler - 07.07.2014

Quote:
Originally Posted by Siralos
Посмотреть сообщение
Just to make sure, can you put a 'return' after every line of checkpoint creation?
SandkingCP[playerid][2] = CreateDynamicRaceCP(0, 383.1623,...

return 0;
Nope doesnt work, when I enter first cp, it sets second CP correctly, but when I enter second cp, then it sets second cp again and again...


Respuesta: CreateDynamicRaceCP help. - Siralos - 07.07.2014

Maybe when creating "2", it's generating it with the same id that you had in "1", as you are destroying it.
So two options:
1) Create the next checkpoint before destroying the previous one
2) Clear the SandkingCP[playerid][X] variable after destroying the checkpoint

(Or to make sure, use both)


Re: Respuesta: CreateDynamicRaceCP help. - tuuler - 07.07.2014

Quote:
Originally Posted by Siralos
Посмотреть сообщение
Maybe when creating "2", it's generating it with the same id that you had in "1", as you are destroying it.
So two options:
1) Create the next checkpoint before destroying the previous one
2) Clear the SandkingCP[playerid][X] variable after destroying the checkpoint

(Or to make sure, use both)
Now when I enter the third CP, it sets the checkpoint back to second CP, and when I enter second CP then it sets it back to third cp and continues to do that.


Respuesta: Re: Respuesta: CreateDynamicRaceCP help. - Siralos - 07.07.2014

Quote:
Originally Posted by tuuler
Посмотреть сообщение
Now when I enter the third CP, it sets the checkpoint back to second CP, and when I enter second CP then it sets it back to third cp and continues to do that.
Did you clear the data? Or just changed order?


Re: Respuesta: Re: Respuesta: CreateDynamicRaceCP help. - tuuler - 07.07.2014

Quote:
Originally Posted by Siralos
Посмотреть сообщение
Did you clear the data? Or just changed order?
I changed order, I dont understand what u mean by clearing data, my english is bad


Respuesta: Re: Respuesta: Re: Respuesta: CreateDynamicRaceCP help. - Siralos - 07.07.2014

Quote:
Originally Posted by tuuler
Посмотреть сообщение
I changed order, I dont understand what u mean by clearing data, my english is bad
SandkingCP[playerid][1] = -1
SandkingCP[playerid][2] = -1

(After destroying every CP)