SA-MP Forums Archive
On enter vehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: On enter vehicle (/showthread.php?tid=552340)



On enter vehicle - cyberlord - 23.12.2014

hello i need help with this scrip :
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{

    for(new i=0; i<sizeof(regitraB); i++)
    {
        ShowPlayerDialog(playerid,CARB,DIALOG_STYLE_MSGBOX,"Praktinis vairavimas","B kategorijos praktinis vairavimas jums kainuos 1000 Euru","Taip","Ne");
    }
    
	return 1;
}
its for driving school when u enter to driving school car "regitraB" its should give u a dialog ye that works , but problem is its give dialog even before its gets to the car i just press enter to get into the car and boom dialog , can some1 tell my how to do that dialog appears only then when u seat into the car tnx


Re: On enter vehicle - Abagail - 23.12.2014

Replace the for(new line with

pawn Код:
if(GetPlayerVehicleID(playerid) == regitraB)



Re: On enter vehicle - cyberlord - 23.12.2014

get error C:\Users\Cyberlord\Desktop\samp server stuff\Samp Server R4\gamemodes\RP.pwn(910) : error 033: array must be indexed (variable "regitraB")