SA-MP Forums Archive
OnPlayerEnterCheckpoint does not fire inside of Interiors? - 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: OnPlayerEnterCheckpoint does not fire inside of Interiors? (/showthread.php?tid=368115)



OnPlayerEnterCheckpoint does not fire inside of Interiors? - Pghpunkid - 12.08.2012

Okay so I have some pretty insane (probably inefficient code) that sets up dynami-- lets get to the point.

Basically your in an interior, and this does nothing to the console:

Код:
public OnPlayerEnterCheckpoint(playerid)
{
	printf("InCheckpoint - ExitCheckpoint: %d - StreamedLocation: %d - Created: %d - ExitSet: %d",StreamedLocation[playerid],ExitCheckpoint[playerid],Checkpoints[StreamedLocation[playerid]][Created],Checkpoints[StreamedLocation[playerid]][ExitSet]);
    ...
}
No errors or anything. The code works as intended. Just doesn't get called while a player is in a checkpoint inside of an interior. OnPlayerLeaveCheckpoint does though, which is why im asking if anyone has seen/experienced this..


Re: OnPlayerEnterCheckpoint does not fire inside of Interiors? - Cjgogo - 12.08.2012

1)Use a streamer(Incognito's Streamer is my choice)
2)Use SendClientMessage(even if printf should work also)


Re: OnPlayerEnterCheckpoint does not fire inside of Interiors? - Pghpunkid - 12.08.2012

CJgogo, thanks for the quick reply. However, Everyone knows a streamer is needed for checkpoints. I have one I coded, it works great. However, it does not fire that callback otherwise the code should work.

Ill take your advice on the SCM bit, but i dont see whats causing it. Just did a simple GM to see if for some odd reason they broke it in 0.3e dev, but it appears to be fine. Im also bumping the CP size up from 1.5 to 2.0.

Something will fire that SOB.

EDIT: Okay so, SCM didn't do anything.. Larger CP didnt help either.. Just funny! Im stumped.


Re: OnPlayerEnterCheckpoint does not fire inside of Interiors? - Kyle - 12.08.2012

Truthfully, I wouldn't code your own streamer as the best of the best is Incognito's, not judging your skills but it's true lol.

Just use a streamer as it's been tailored for the past few years to get it to be the plugin it is today.


Re: OnPlayerEnterCheckpoint does not fire inside of Interiors? - FireCat - 12.08.2012

Hmm try just printing the the interior right before that print you have.
Aswell, change that return 1 to return print("Checkpoint callback called")


Re: OnPlayerEnterCheckpoint does not fire inside of Interiors? - playbox12 - 12.08.2012

It may have something to do with your streamer, but I don't know why don't you try incognitos streamer, create a CP in an interior and see if it prints. (do you actually see the checkpoint in the interior?).


Re: OnPlayerEnterCheckpoint does not fire inside of Interiors? - Pghpunkid - 12.08.2012

Quote:
Originally Posted by playbox12
Посмотреть сообщение
It may have something to do with your streamer, but I don't know why don't you try incognitos streamer, create a CP in an interior and see if it prints. (do you actually see the checkpoint in the interior?).
The reason I dont use other peoples streamers is because its a simple computation. Check if they are in a set range, and if they are display it, assign it to a variable as their location so you are trying to recreate the checkpoint every second or w/e your timer is, and your done.

I do see the checkpoint. I got a little flustered by this so I decided to just make it display and make it work off of KeyStateChange. Well, with the KEY_SPRINT key, it only works on enter. Same thing, it wont fire the callback.. what gives!!

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{

	if (newkeys & KEY_SPRINT)
	{
	    printf("InCheckpoint - ExitCheckpoint: %d - StreamedLocation: %d - Created: %d - ExitSet: %d",ExitCheckpoint[playerid],StreamedLocation[playerid],Checkpoints[StreamedLocation[playerid]][Created],Checkpoints[StreamedLocation[playerid]][ExitSet]);
    ...
}
Ill try doing the return printf() as suggested, but im not sure its going to work. Quite annoyed.


Re: OnPlayerEnterCheckpoint does not fire inside of Interiors? - Kyle - 12.08.2012

You state you might as well make your own as it's simple, but then you must create your own which takes time.

I just don't see why you don't make your own personally.