SA-MP Forums Archive
Private 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Private Vehicle (/showthread.php?tid=79237)



Private Vehicle - Puzi - 26.05.2009

Hi there.

I have added some cars on my RPG for my members, but people steal them which is a problem. Would it be possible if someone could give me a ready script so it would say when someone enters the car 'This vehicle belongs to 'Player'. Do not steal it! and then this person is forced to get out of the car. Do you get me? So only the person who owns the car, has a entry to it. I hope you understand me, excuse my english

Thanks and Regards
Puzi


Re: Private Vehicle - JoeDaDude - 26.05.2009

That isnt hard to make...


Re: Private Vehicle - Weirdosport - 26.05.2009

You have 2 choices. You lock the car or you eject people when they get in.

https://sampwiki.blast.hk/wiki/SetVehicleParamsForPlayer (you need to loop it for all players)

or

OnPlayerEnterVehicle:
https://sampwiki.blast.hk/wiki/RemovePlayerFromVehicle
And message them.

Quote:
Originally Posted by JoeDaDude
That isnt hard to make...
That's not a very useful post..


Re: Private Vehicle - Puzi - 26.05.2009

I want so it removes player from the car and he cannot get in and a message is showed up. But i dont understand the second link Would it be possible to get a ready code from you?

P.S - Sorry, im n00b at scripting xD.


Re: Private Vehicle - Weirdosport - 26.05.2009

Change the "if(Vehicle isn't theres)" bit to suit you, and try both idk how they'll turn out.

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(Vehicle isn't theres)
    {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, 0xFF00FFFF, "You'
re a tard");
    }
    return 1;
}
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
      if(Vehicle isn't theres)
      {
        RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, 0xFF00FFFF, "You'
re a tard");
        }
    }
  return 1;
}



Re: Private Vehicle - JoeDaDude - 26.05.2009

Quote:
Originally Posted by Weirdosport
Quote:
Originally Posted by JoeDaDude
That isnt hard to make...
That's not a very useful post..
I would'nt of said that, And would of posted the code if i didnt make a promise


Re: Private Vehicle - Puzi - 26.05.2009

Thank you, i'll try that, if they won't work, ill post back here


Re: Private Vehicle - Puzi - 26.05.2009

Sorry for double post if applies :P

They both don't work unfortunately They have both 5 errors, but sometimes are different. Btw I don't think I said it, but I want also only the player under desired nick to be able to get in the car. So for e.g. Puzi can go into the car, and rest cannot. If they do, kill!


Re: Private Vehicle - Weirdosport - 26.05.2009

You have to change the if bit to suit your script.


Re: Private Vehicle - Puzi - 26.05.2009

Seems to work, but i don't quite understand you (sorry ). For example, what should i type into the if bit?

//edit: nevermind, got it working, Thank you very much mate!