only cops can enter police vehicles
#1

ok i want to make it fair, only cops can enter police vehicles, like Police Maveric, LSPD Car, Swat Van........

thanks
Reply
#2

OnPlayerEnterVehicle or sumthing
then if(GetVehicleModel(vehicleid) == 59 thats a LVPD car i thought
then RemovePlayerFromVehicle(playerid);
and SendClientMessage
Reply
#3

What about using ifplayerskin (skinid, playerid,);?
Reply
#4

GetVehicleModel(vehicleid,) == 59;
if playerskin(skinid, playerid,) == copskin;
then
return = 1
else
removeplayerfromvehicle(playerid,);
printf = You aren't allowed to enter this car!
Reply
#5

use gTeam
Reply
#6

why not explain more clear

pawn Код:
public OnPlayerUpdate(playerid)
{
    new vehicle;
    vehicle = GetPlayerVehicleID(playerid);
    if(gTeam[playerid] == your team) // team u want to remove
    {
        if(vehicle > 411) // car id for example i used a infernus
        {
            RemovePlayerFromVehicle(playerid); // removes player from vehicle
            SendClientMessage(playerid, your color, "SERVER: You can not enter this vehicle"); // message you want to send to the player that is not in your team
        }
    }


}
EDIT: for cops to enter vehicle the top one was the team not allowed the bottom one is the team allowed to enter

pawn Код:
public OnPlayerUpdate(playerid)
{
    new vehicle;
    vehicle = GetPlayerVehicleID(playerid);
    if(gTeam[playerid] == your team) // team that is allow to enter the car
    {
        if(vehicle > 411) // car id for example i used a infernus
        {
            SendClientMessage(playerid, your color, "SERVER: Welcome to your vehicle"); // message for the person allow to enter
        }
    }

}
Reply
#7

Yes, but with gTeam it creates different classes, that way it causes a hell of a lot bugs.
Just do ifplayerskin.
Reply
#8

Quote:
Originally Posted by Duck
Посмотреть сообщение
Yes, but with gTeam it creates different classes, that way it causes a hell of a lot bugs.
Just do ifplayerskin.
ok.

pawn Код:
if(GetPlayerTeam(playerid) == TEAM_COPS) // Assumed you either did AddPlayerClassEx / SetPlayerTeam.
Reply
#9

**Post removed**
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)