Checkpoint Disable
#1

Alright so I have a problem with disabling checkpoint..
I added some checkpoints to help players to easier find requested location but once I reach to the checkpoint,
checkpoint don't want to disable

Код:
CMD:locate(playerid, params[])
{
    new location[32];
	if(sscanf(params, "s[128]", location))
	{
	SendClientMessageEx(playerid, COLOR_GREEN, "________________________________________________");
   	SendClientMessageEx(playerid, COLOR_YELLOW, "<< General & Job Locations, USAGE: /locate [location]>>");
   	SendClientMessageEx(playerid, COLOR_ORANGE, "General Locations: LSVIP , DMV, CrackLab, DrugHouse, Heroinlab");
   	SendClientMessageEx(playerid, COLOR_ORANGE, "Job Locations: Courier, Mechanic, Bodyguard, Bodyguard2 PizzaBoy, ArmsDealer, DrugDealer ");
   	SendClientMessageEx(playerid, COLOR_ORANGE, "Job Locations: DrugSmuggler, Miner, LumberJack, Lawyer, Detective, Taxi");
	return 1;
	}
	if(strcmp(params, "lsvip", true) == 0) {
	    if(CheckPointCheck(playerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you have active checkpoint).");
	    SendClientMessageEx(playerid, COLOR_RED, "Checkpoint set to Los Santos DMV");
	    DisablePlayerCheckpoint(playerid);
	    SetPlayerCheckpoint(playerid, 691.2667,-1276.0730,13.5605,2.0);
	}
	else if(strcmp(params, "dmv", true) == 0) {
	    if(CheckPointCheck(playerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you have active checkpoint).");
	    SendClientMessageEx(playerid, COLOR_RED, "Checkpoint set to Los Santos DMV");
	    DisablePlayerCheckpoint(playerid);
	    SetPlayerCheckpoint(playerid, 1219.2233,-1812.1866,16.5938,2.0);
	}
        (.....more checkpoints...)
	return 1;
}
I don't know why this code doesn't work, I checked other checkpoints in script and that code disable checkpoint easly.
Код:
DisablePlayerCheckpoint(playerid);
Reply
#2

If I've understood your question correctly, you're trying to disable the checkpoint when the player enters it, if so I believe you should be using OnPlayerEnterCheckpoint https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint

Can you show us the code you have for OnPlayerEnterCheckpoint?
Reply
#3

I tried with OnPlayerEnterCheckpoint but still no changes..
I removed that callback so I don't have it anymore.. But I saw that link and few tutorials about checkpoint and none didn't help me..
Reply
#4

Not too sure about this one then sorry, I would just try adding this again to your script and seeing what happens.
Код:
public OnPlayerEnterCheckpoint(playerid)
{
    SendClientMessage(playerid, 0xFFFFFFFF, "You have entered a checkpoint");
    DisablePlayerCheckpoint(playerid);
    return 1;
}
If the message is sent but the checkpoint remains then perhaps somewhere in your script the checkpoint is being created on a loop.
Reply
#5

Quote:
Originally Posted by MEW273
Посмотреть сообщение
Not too sure about this one then sorry, I would just try adding this again to your script and seeing what happens.
Код:
public OnPlayerEnterCheckpoint(playerid)
{
    SendClientMessage(playerid, 0xFFFFFFFF, "You have entered a checkpoint");
    DisablePlayerCheckpoint(playerid);
    return 1;
}
If the message is sent but the checkpoint remains then perhaps somewhere in your script the checkpoint is being created on a loop.
Works fine now, Checkpoint is disabling now, thanks man.. Rep+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)