only cops can enter police vehicles -
Black_Sun1 - 31.10.2010
ok i want to make it fair, only cops can enter police vehicles, like Police Maveric, LSPD Car, Swat Van........
thanks
Re: only cops can enter police vehicles -
Mike_Peterson - 31.10.2010
OnPlayerEnterVehicle or sumthing
then if(GetVehicleModel(vehicleid) == 59

thats a LVPD car i thought
then RemovePlayerFromVehicle(playerid);
and SendClientMessage
Re: only cops can enter police vehicles -
Duck - 31.10.2010
What about using ifplayerskin (skinid, playerid,);?
Re: only cops can enter police vehicles -
Duck - 31.10.2010
GetVehicleModel(vehicleid,) == 59;
if playerskin(skinid, playerid,) == copskin;
then
return = 1
else
removeplayerfromvehicle(playerid,);
printf = You aren't allowed to enter this car!
Re: only cops can enter police vehicles -
WillyP - 31.10.2010
use gTeam
Re: only cops can enter police vehicles -
Kitten - 31.10.2010
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
}
}
}
Re: only cops can enter police vehicles -
Duck - 31.10.2010
Yes, but with gTeam it creates different classes, that way it causes a hell of a lot bugs.
Just do ifplayerskin.
Re: only cops can enter police vehicles -
Cameltoe - 31.10.2010
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.
Re: only cops can enter police vehicles -
Steven82 - 31.10.2010
**Post removed**