• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] [SOLVED] how make a correct IF function with for parameter vehicle ID == enum id
#1
SOLUTION:

Code:
stock IsPlayerInDealerVehicle(playerid)



{



new s; new invehicleid = GetPlayerVehicleID(playerid);



for( s=1; s<MAX_SALON_SLOT; s)



? ? ? ? {











for(new salon=1; salon<MAX_SALON; salon)



? ? ? ? {



? ? ? ? ? ? ?



? ? ? ? ? ? ? if(SalonCarIdSlot[salon][s] == invehicleid)



? ? ? ? ? ? ? {



? ? ? ? ? ? ??







? ? ? ? ? ? ? SetPVarInt(playerid, "UseIdSalon", salon);







SetPVarInt(playerid, "UseSlotSalon", s);



? ? ? ? ? ? ? new sVehSlotDeal = s;



? ? ? ? ? ? ? new salonDealID = salon;



? ? ? ? ? ? ? new st[160];



format(st,sizeof(st),"Anda yakin ingin membeli nomor tansport %i?\n\nModel: %s\nBiaya: $%i",



sVehSlotDeal ,NameCars(SalonModelSlot[salonDealID][sVehSlotDeal]),SalonPriseSlot[salonDealID][sVehSlotDeal]);



ShowPlayerDialog(playerid,64, DIALOG_STYLE_MSGBOX, "Pasar mobil", st, "Untuk membeli", "Keluarlah");



? ? ? ? ? ? ? return true;



? ? ? ? ? ? ? }



? ? ? ? ? ? ?







? ? ? ? }



}? ? ? ? ?











return 0;







}



how to make a correct IF function with the required parameter for a vehicle ID that has many Increments?

I find it difficult to match the player into a particular car.



Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)

{

if(!ispassenger)

{

new slot=GetPVarInt(playerid,"SalonSlot");

new salon;

for(new s=1;s<MAX_SALON_SLOT;s)

? ? ? ? ? ? {

? ? ? ? ? ? ?







if(vehicleid == SalonCarIdSlot[salon][s] )

{

new st[160];

format(st,sizeof(st),"Anda yakin ingin membeli nomor tansport %i?\n\nModel: %s\nBiaya: $%i",slot,NameCars(SalonModelSlot[s][slot]),SalonPriseSlot[s][slot]);

ShowPlayerDialog(playerid,64, DIALOG_STYLE_MSGBOX, "Pasar mobil", st, "Untuk membeli", "Keluarlah");

}





}



}





// IS THE CODE TRUE FOR ?

// If function detect is that vehicle a vehicle created for dealer vehicle

}



How to display dialog style on certain vehicles group enum?
  Reply


Messages In This Thread
[SOLVED] how make a correct IF function with for parameter vehicle ID == enum id - by PutuSuhartawan - 2021-04-30, 10:50 PM

Forum Jump: