Stop a Team From Using Cars? -
lSCARl - 11.08.2010
how can i make a team not be able to use cars
Code:
if(gTeam[playerid] == TEAM_HIDER)
what should i put after that
Re: Stop a Team From Using Cars? -
Kitten - 11.08.2010
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(gTeam[playerid] == TEAM_HIDER)
{
RemovePlayerFromVehicle(playerid);
}
Re: Stop a Team From Using Cars? -
lSCARl - 11.08.2010
Quote:
Originally Posted by Kitten
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(gTeam[playerid] == TEAM_HIDER) { RemovePlayerFromVehicle(playerid); }

|
Help Define this and stuff please
Re: Stop a Team From Using Cars? -
mrmuffins - 11.08.2010
Quote:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
|
Checks if the person enters a vehicle, if so:
Quote:
if (gTeam[playerid] == TEAM_HIDER)
|
If the person team is equal to whatever value the constant TEAM_HIDER contains, example 1.
If so:
Quote:
RemovePlayerFromVehicle(playerid);
|
Forces the player to be removed from the vehicle that they are in.
A complete example:
Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) {
if (gPlayer_Team[playerid] == TEAM_COP && vehicleid == 497 && !ispassenger) { //If I enter a police marvick and I am the driver, NOT a passager
SendClientMessage(playerid, COLOR_SRED, "You are not a cop and cannot drive this!"); //Send a message
RemovePlayerFromVehicle(playerid); //Remove me
}
return 1;
}
Hope this helps.
Re: Stop a Team From Using Cars? -
lSCARl - 11.08.2010
Quote:
Originally Posted by mrmuffins
Checks if the person enters a vehicle, if so:
If the person team is equal to whatever value the constant TEAM_HIDER contains, example 1.
If so:
Forces the player to be removed from the vehicle that they are in.
A complete example:
Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) {
if (gPlayer_Team[playerid] == TEAM_COP && vehicleid == 497 && !ispassenger) { //If I enter a police marvick and I am the driver, NOT a passager
SendClientMessage(playerid, COLOR_SRED, "You are not a cop and cannot drive this!"); //Send a message
RemovePlayerFromVehicle(playerid); //Remove me
}
return 1;
}
Hope this helps.
|
How Can i Make it so it wont let the team in ANY cars?
Re: Stop a Team From Using Cars? -
mrmuffins - 11.08.2010
That was just an explanation and example.
Kitten's post works for that.
Quote:
Originally Posted by Kitten
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(gTeam[playerid] == TEAM_HIDER) { RemovePlayerFromVehicle(playerid); }

|
Re: Stop a Team From Using Cars? -
lSCARl - 11.08.2010
Quote:
Originally Posted by mrmuffins
That was just an explanation and example.
Kitten's post works for that.
|
Okay When i use kittens it doesnt work it wont remove me from the car
Re: Stop a Team From Using Cars? -
mrmuffins - 11.08.2010
Are you positive that your team is TEAM_HIDER ?
Look up at the top and find the:
#define TEAM_HIDER
And should be a number there like 1, and be sure your team is also set to that number.
As well as your setting the gTeam to a value and not leaving it standing as null.
Re: Stop a Team From Using Cars? -
lSCARl - 11.08.2010
Quote:
Originally Posted by mrmuffins
Are you positive that your team is TEAM_HIDER ?
Look up at the top and find the:
#define TEAM_HIDER
And should be a number there like 1, and be sure your team is also set to that number.
As well as your setting the gTeam to a value and not leaving it standing as null.
|
Yeah its TEAM_HIDER 0 i dont know whats wrong
Re: Stop a Team From Using Cars? -
Kitten - 11.08.2010
at top
after
pawn Code:
static gTeam[MAX_PLAYERS];
my code works perfect on my gamemode
if not show my ur script i guess?