PlayerInfo[playerid][TaxiDuty] = 1;
g_Vehicle[9] = CreateVehicle(409, 952.2495, -1354.0212, 13.1623, 271.4942, 6, 6, -1); //Stretch
g_Vehicle[10] = CreateVehicle(560, 966.7414, -1355.2747, 13.0566, 179.6440, 6, 175, -1); //Sultan
g_Vehicle[11] = CreateVehicle(420, 950.9326, -1390.5573, 13.0804, 90.2256, 6, 12, -1); //Taxi
g_Vehicle[12] = CreateVehicle(438, 958.2101, -1390.4835, 13.2839, 88.7154, 6, 70, -1); //Cabbie
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
// check if vehicle id is g_Vehicle and the player is not on duty
// if it is, send message and return 0.
//else return 1
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
// check if vehicle id is g_Vehicle and the player is not on duty
if(vehicleid == g_Vehicle[9] && !PlayerInfo[playerid][TaxiDuty]) {
// if it is, send message and return 0.
return 0;
}
//else return 1
return 1;
}
new g_Vehicle[13];
if(GetVehicleModel(g_Vehicle[9]))
{
if(PlayerInfo[playerid][TaxiDuty] == 0)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You are not on taxi duty!");
}
}
return 1;
new g_Vehicle[13];
if(vehicleid == g_Vehicle[9] && PlayerInfo[playerid][TaxiDuty] == 0)
{
SendClientMessage(playerid, COLOR_RED, "You are not on taxi duty!");
RemovePlayerFromVehicle(playerid);
}
new g_Vehicle[13];
stock in_array(needle, const haystack[], size = sizeof haystack, &index = 0)
{
for(new i; i < size; i++)
{
if(haystack[i] == needle)
{
index = i;
return true;
}
}
return false;
}
if(in_array(vehicleid, g_Vehicle) && PlayerInfo[playerid][TaxiDuty] == 0)
Put this somewhere:
PHP код:
PHP код:
|
new true_or_false_shit;
in_array(the statements that should be used and then, true_or_false_shit);
if(true_or_false_shit == 1)
print("it exists in the array");