SA-MP Forums Archive
How do they do it? - 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: How do they do it? (/showthread.php?tid=298284)



How do they do it? - Saurik - 20.11.2011

I was just wondering. Basically on a server you can't use a hydra unless you are rank 5. So when you get in and you'r not rank 5, it kicks you out.

Somehow, sometimes people who are not rank 5 can fly it.. How is this possible ?


Re: How do they do it? - Calgon - 20.11.2011

RemovePlayerFromVehicle sometimes, but rarely, doesn't properly eject a player out of a vehicle. Plus, the famous 'NOP RemovePlayerFromVehicle' is often used. Some servers seem to counteract it with setting the player position away from the vehicle, though.


Re: How do they do it? - Joshb93 - 20.11.2011

You need to do this (depening on your player info variables) (under OnPlayerEnterVehicle)

new vid = GetPlayerVehicleID(playerid);
new vehicle =GetVehicleModel(vid);
if(PlayerInfo[playerid][Rank] < 5 && Vehicleid == 520))
{
new Float:posx, Float:posy, Float:posz;
GetPlayerPos(playerid, posx, posy, posz);
SetPlayerPos(playerid, posx, posy, posz);
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_HERE, "You must be rank 5 to enter this vehicle!");
return 1;
}


Re: How do they do it? - [L3th4l] - 20.11.2011

Variable failure?

pawn Код:
OnPlayerStateChange(....)
{
    if(newstate == PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 520 && RankVar[playerid] != 5)
    {
        // Kick player out of vehicle
    }
}
Not sure if that's what you are looking for though
Again, could be a problem with your variables.


Re: How do they do it? - Saurik - 20.11.2011

Код:
if(newstate == PLAYER_STATE_DRIVER)
{
new vehid = GetPlayerVehicleID(playerid);
new vehicle =GetVehicleModel(vehid);
if(vehicle == 520)
{
if(PlayerInfo[playerid][Rank] < 5)
{
RemovePlayerFromVehicle(playerid);
shouldnt have problems


Re: How do they do it? - Joshb93 - 20.11.2011

Quote:
Originally Posted by Saurik
Посмотреть сообщение
Код:
if(newstate == PLAYER_STATE_DRIVER)
{
new vehid = GetPlayerVehicleID(playerid);
new vehicle =GetVehicleModel(vehid);
if(vehicle == 520)
{
if(PlayerInfo[playerid][Rank] < 5)
{
RemovePlayerFromVehicle(playerid);
shouldnt have problems
In everything ive ever done regarding this, if(newstate == PLAYER_STATE_DRIVER) that never worked, i used what i posted above.. just make sure you define IsAHydra(vehicleid) somewhere in your script, EX:


Re: How do they do it? - Saurik - 20.11.2011

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
Variable failure?

pawn Код:
OnPlayerStateChange(....)
{
    if(newstate == PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 520 && RankVar[playerid] != 5)
    {
        // Kick player out of vehicle
    }
}
Not sure if that's what you are looking for though
Again, could be a problem with your variables.
it is what im looking for and my script is basically the same thing