Posts: 240
Threads: 5
Joined: Nov 2017
27.11.2017, 16:12
(
Последний раз редактировалось rfr; 28.11.2017 в 15:47.
)
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;
}
{
}
}