• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Long callback execution
#3
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.



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;

}
  Reply


Messages In This Thread
Long callback execution - by Snow - 2021-05-02, 02:10 AM
RE: Long callback execution - by Y_Less - 2021-05-02, 07:29 PM
RE: Long callback execution - by kemper - 2021-05-02, 07:37 PM
RE: Long callback execution - by Y_Less - 2021-05-02, 11:32 PM
RE: Long callback execution - by Snow - 2021-05-03, 03:35 AM
RE: Long callback execution - by AbyssMorgan - 2021-05-03, 06:37 AM
RE: Long callback execution - by Y_Less - 2021-05-03, 01:19 PM
RE: Long callback execution - by Snow - 2021-05-03, 03:03 PM
RE: Long callback execution - by Y_Less - 2021-05-03, 03:48 PM
RE: Long callback execution - by Snow - 2021-05-03, 05:39 PM

Forum Jump: