public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new newcar;
if(CopCar(newcar))
{
if (gTeam[playerid] == TEAM_COPS)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You're not in the police team");
}
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate) {
if (oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) {
new newcar = GetPlayerVehicleID(playerid);
if (CopCar(newcar)) {
if (gTeam[playerid] != TEAM_COPS) {
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You're not in the police team");
}
}
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
new newcar = GetPlayerVehicleID(playerid);
if(CopCar(newcar))
{
if (gTeam[playerid] != TEAM_COPS){
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You're not in the police team"); return 1; }
// continued code if the player is a cop
}
}
return 1;
}
PHP код:
|