SA-MP Forums Archive
[Help]Private Cars - 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: [Help]Private Cars (/showthread.php?tid=398696)



[Help]Private Cars - RevolutionLite - 10.12.2012

Hello,

First of all i want to tell you that I've tried most private car tutorials and non of them seem to work.


I wan't it so that when the player enter's it reads the name and if it isn't a designated name it ejects them out of it.
These vehicles will be placed around the map at where the player want's, <-- I know how to create it spawning where the player wants


I use:

DCMD
sccanf2
y_ini
streamer
Dini

Thanks for the help

~RevolutionLite


Re: [Help]Private Cars - WoodPecker - 10.12.2012

You can't ask someone to script for you in this section.


Re: [Help]Private Cars - RevolutionLite - 11.12.2012

Quote:
Originally Posted by WoodPecker
Посмотреть сообщение
You can't ask someone to script for you in this section.
I'm not, I'm asking for HELP. Like what to use and how to start. That's not scripting for someone. It's giving useful tips


AW: [Help]Private Cars - Kevin54321 - 11.12.2012

https://sampwiki.blast.hk/wiki/OnPlayerEnterVehicle
or: https://sampwiki.blast.hk/wiki/OnPlayerStateChange

https://sampwiki.blast.hk/wiki/RemovePlayerFromVehicle

Then something like "new privatecar[MAX_VEHICLES];" (= playerid).

OnPlayerEnterVehicle:
if(privatecar[vehicleid] == playerid) -> Everything is okey, else -> RemovePlayerFromVehicle

OnPlayerStateChange:
if (newstate == PLAYER_STATE_DRIVER)
-> if(privatecar[vehicleid] == playerid) -> Everything is okey, else -> RemovePlayerFromVehicle

Notes:
- Only for the driver or for both (driver and passengers)? -> See wiki (ispassenger,states)
- OnPlayerEnterVehicle only works if you "press f (or another key)", but if you get teleported into the car it doesnt work!)


Re: AW: [Help]Private Cars - RevolutionLite - 12.12.2012

Quote:
Originally Posted by Kevin54321
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/OnPlayerEnterVehicle
or: https://sampwiki.blast.hk/wiki/OnPlayerStateChange

https://sampwiki.blast.hk/wiki/RemovePlayerFromVehicle

Then something like "new privatecar[MAX_VEHICLES];" (= playerid).

OnPlayerEnterVehicle:
if(privatecar[vehicleid] == playerid) -> Everything is okey, else -> RemovePlayerFromVehicle

OnPlayerStateChange:
if (newstate == PLAYER_STATE_DRIVER)
-> if(privatecar[vehicleid] == playerid) -> Everything is okey, else -> RemovePlayerFromVehicle

Notes:
- Only for the driver or for both (driver and passengers)? -> See wiki (ispassenger,states)
- OnPlayerEnterVehicle only works if you "press f (or another key)", but if you get teleported into the car it doesnt work!)
Thanks this is what i've been looking for !