SA-MP Forums Archive
Scripting help :D for vehicle permissions - 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: Scripting help :D for vehicle permissions (/showthread.php?tid=439867)



Scripting help :D for vehicle permissions - john77 - 27.05.2013

Hey guys I just need help with a scripting, I am what you would call a n00b but I am still learning.

Okay so I want to have a script that kicks players out of the car when “players” get in specific vehicles just players not admins the specific vehicles are
Hydra
Hunter
Sea sparrow
And can there be a message saying this is a admin vehicle or military.
For every helpful comment I will give REP’s

THANKS


Re: Scripting help :D for vehicle permissions - mahdi499 - 27.05.2013

You can find this in tutorials,and Optimize your code As you like,it's explained.


Re: Scripting help :D for vehicle permissions - john77 - 27.05.2013

you made it sooo good you got a copy?


Re: Scripting help :D for vehicle permissions - mahdi499 - 27.05.2013

pawn Code:
new Hydras[30];

IsAHydra(carid)
{
    for(new v = 0; v < sizeof(Hydras); v++)
    {
        if(carid == Hydras[v]) return 1;
    }
    return 0;
}

OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsAHydra(vehicleid))
    {
        if(IsPlayerAdmin(playerid))
        {
        }
        else
        {
            RemovePlayerFromVehicle(playerid);
            new Float:X, Float:Y, Float:Z;
            GetPlayerPos(playerid, X, Y, Z);
            SetPlayerPos(playerid, X, Y, Z);
            SendClientMessage(playerid, -1, "You can't enter Hydras");
            return 1;
        }
       
    }
    return 1;
}
don't forget to add Hydras[number] = before each hydra


Re: Scripting help :D for vehicle permissions - john77 - 27.05.2013

I saved this 100 times lol, hydra numbers? :/


Re: Scripting help :D for vehicle permissions - mahdi499 - 27.05.2013

The Hydras[number] =
You replace number by 0,1,2,3,4 you know


Re: Scripting help :D for vehicle permissions - john77 - 27.05.2013

:/ 0 1 2 3 4? What is this for? and where to replace, here? new Hydras[30];


Re: Scripting help :D for vehicle permissions - mahdi499 - 27.05.2013

No,i said Place Behinde Each Hydra you spawned This Hydras[1] = and Hydras[2] = Like this for each hydra


Re: Scripting help :D for vehicle permissions - john77 - 27.05.2013

But I don't know how many hydra's are there? can I have any and every hydra


Re: Scripting help :D for vehicle permissions - [..MonTaNa..] - 27.05.2013

Do you want so only admins can use hydra ?