2021-05-02, 07:37 PM
I wouldn't call this code terrible or something. But there is a logical error.
If you have met the condition you need, then break out of the loop.
Also you already know vehicleid so you don't need to call GetPlayerVehicleID every time.
If you have met the condition you need, then break out of the loop.
Also you already know vehicleid so you don't need to call GetPlayerVehicleID every time.
Code:
public OnPlayerExitVehicle(playerid, vehicleid)
{
? ? ? ? InCar[playerid] = 0;
? ? ? ? LastCar[playerid] = vehicleid;
? ? ? ? if(DeliveryMan[playerid])
? ? ? ? {
? ? ? ? ? ? for(new i; i < sizeof(Burrito_ID); i)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if(vehicleid == Burrito_ID[i])
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? SendClientMessage(playerid, COLOR_COURIER, "* Press Y behind your vehicle to pickup the goods.");
break;
? ? ? ? ? ? ? ? }?
? ? ? ? ? ? }
? ? ? ? ?
? ? ? ? }
? ? ? ? return 1;
}