OnPlayerEnterDynamicCP Messing up.
#2

You should use
pawn Код:
if (..)
else if(..)
else if(..)
instead of just using if statements.

This is what's happening with your code.

Enters callback with checkpointid being 15

if(checkpointid == DrivingCheck[playerid][1])
-> checkpointid (value of 15) == DrivingCheck[playerid][0] (value of 15) is true so enters code block
->-> destroy checkpoint (next checkpoint created will be id 15 again)
->-> DrivingCheck[playerid][2] = CreateCP(..) //recreate checkpoint (returns id 15)
->->-> leaves if statement..
if(checkpointid == DrivingCheck[playerid][2]) // checkpointid is 15 and so is the value of DrivingCheck[playerid][2] because of the returned value from CreateCP(..).

repeat until the end.

Hope that makes sense xD
Reply


Messages In This Thread
OnPlayerEnterDynamicCP Messing up. - by Dokins - 20.02.2016, 01:57
Re: OnPlayerEnterDynamicCP Messing up. - by EiresJason - 20.02.2016, 02:43
Re: OnPlayerEnterDynamicCP Messing up. - by Dokins - 20.02.2016, 02:48
Re: OnPlayerEnterDynamicCP Messing up. - by Dokins - 20.02.2016, 02:55
Re: OnPlayerEnterDynamicCP Messing up. - by EiresJason - 20.02.2016, 03:10
Re: OnPlayerEnterDynamicCP Messing up. - by Dokins - 20.02.2016, 03:14
Re: OnPlayerEnterDynamicCP Messing up. - by Shaheen - 20.02.2016, 07:53
Re: OnPlayerEnterDynamicCP Messing up. - by Dokins - 20.02.2016, 11:49

Forum Jump:


Users browsing this thread: 1 Guest(s)