SA-MP Forums Archive
Checkpoint Problem - 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: Checkpoint Problem (/showthread.php?tid=645470)



Checkpoint Problem - Cutiexoxo - 27.11.2017

I have added a new taxi job system, My gamemode has some Checkpoints , So for example when i start taxi job i get Red Checkpoint on map but if i drive near a cp from my gamemode the Taxi Cp disappear any HELP pleaseee
+Rep for eveyone who Helped me i'm stuck :/
My question is can we replace checkpoints with something else ?


Re: Checkpoint Problem - lNoobOnDutyl - 27.11.2017

Use something like:

Quote:

public OnPlayerEnterCheckpoint(playerid)
{
if(TaxiJob[playerid] == 1)
{
something
return 1;
}

To let the player only use the checkpoint if he has a certain value.


Re: Checkpoint Problem - rfr - 27.11.2017

Quote:
Originally Posted by lNoobOnDutyl
Посмотреть сообщение
Use something like:

Quote:

public OnPlayerEnterCheckpoint(playerid)
{
if(TaxiJob[playerid] == 1)
{
something
return 1;
}

To let the player only use the checkpoint if he has a certain value.
I'm sure a more efficient way would be (or a way most people use)
PHP код:
//instead of ==1
if(TaxiJob[playerid])
//for false
if(!TaxiJob[playerid]) 
Expanding on this:
PHP код:
new IsPlayerTaxiDriver[MAX_PLAYERS];
CMD:taxi(playerid,params[])
{
        if (!
IsPlayerTaxiDriver[playerid]) //if they are not on duty turn it on
        
{
            
SendClientMessage(playerid, -1"You have toggled taxi driver on");
            
toggleHelper[playerid] = true;
        }
        else if (
IsPlayerTaxiDriver[playerid]) //if they are on duty turn it off
        
{
            
SendClientMessage(playerid, -1"You have toggled taxi driver off.");
            
toggleHelper[playerid] = false;
        }
}
public 
OnPlayerEnterCheckpoint(playerid)
{
if(
IsPlayerTaxiDriver[playerid]) //allow them
{
    
SendClientMessage(playerid, -1"it works");
}
else
{
    
SendClientMessage(playerid, -1"you're not a taxi driver");
    return 
1;
}
{
}




Re: Checkpoint Problem - Cutiexoxo - 27.11.2017

Thanks Guys +Rep Both of you