SA-MP Forums Archive
i want to learn ? - 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: i want to learn ? (/showthread.php?tid=364847)



i want to learn ? - NuLIO - 01.08.2012

hi guys , how can i add objects on car and how make admin only he drive it , i dont want cmd to give him car i want like AddStaticVehicle and it save with objects ?

plz guys help , who will help me i will +rep for him


Re: i want to learn ? - Ballu Miaa - 01.08.2012

What ever your trying to do right now , comes in the Advance Scripting section in my view. Created Objects can be Attached to a vehicle with https://sampwiki.blast.hk/wiki/AttachObjectToVehicle

You will need a vehicle system which saves the info of the vehicle. You will need to add some more features into it for this


Re: i want to learn ? - Ranama - 01.08.2012

You'll have to do a array, like:

Код:
new AdminCars[number of cars]{
//You list the cars here like this
AddStaticVehicle(bla, bla, bla),
AddStaticVehicle(bla, bla, bla),
AddStaticVehicle(bla, bla, bla)
}

//and then on the command/callback you do it like this

for(new i = 0; i < MAX_VEHICLES; i++){
if(vehicleid == AdminCars[i] && PInfo[playerid][adminlevel] < 1)return SendClientMessage(playerid, COLOR_RED, "This is an admincar, you can not enter");
}
Change the cariables to your choise and I'm not 100% this is a good code, but you are doing it something like this i know.

Hope i helped