you put it under ongamemodeinit just like the example on the link i gave you.
A rent and buy system would be a bit harder i suggest you try adding vehicles first and when you learned that you can try further.
on addstaticvehicle the first number you see is the 'id' of the vehicle wich you can also find here; http://weedarr.wikidot.com/veh
The last 2 numbers on addstaticvehicle are the colors
if you wanna learn more or have questions just PM me
Do you realy need to use those ' it!!! ' looks like your yelling at me
So ..with just a command ? okay thats kind of easy i wont script it for you cause that takes time and you wont be learning. But it should look like something like this;
Put it under onplayercommand something like here;
public onplayercommand
sendclientmessage ( a message that ask you if you want to buy or rent a car)
if (part where you make the command like /buy or /rent)
{
getplayerstate;
if PLAYERSTATE_DRIVER --here it tells the script that you are in a vehicle while typing this command
{
(something to unlock your car)
}
Look it up on wiki samp im sure you can figure it out.