15.02.2011, 19:11
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[128];
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(Spectate[i] != 255)
{
PlayerSpectateVehicle(i,vehicleid);
}
}
}
if(IsAGSFCar(vehicleid) && IsPlayerAMemberOf(playerid) != 1)
{
format(string,sizeof(string),"You can't drive this vehicle because you are not a member of the Grove Gang!");
SendClientMessage(playerid, COLOR_LIGHTRED, string);
RemovePlayerFromVehicle(playerid);
}
else if(IsABCar(vehicleid) && IsPlayerAMemberOf(playerid) != 2)
{
format(string,sizeof(string),"You can't drive this vehicle because you are not a member of the Ballas Gang");
SendClientMessage(playerid, COLOR_LIGHTRED, string);
RemovePlayerFromVehicle(playerid);
}
else if(IsALCNCar(vehicleid) && IsPlayerAMemberOf(playerid) != 3)
{
format(string,sizeof(string),"You can't drive this vehicle because you are not a member of the La Cosa Nostra Mafia");
SendClientMessage(playerid, COLOR_LIGHTRED, string);
RemovePlayerFromVehicle(playerid);
}
else if(IsAYCar(vehicleid) && IsPlayerAMemberOf(playerid) != 4)
{
format(string,sizeof(string),"You can't drive this vehicle because you are not a member of the Yakuza Mafia");
SendClientMessage(playerid, COLOR_LIGHTRED, string);
RemovePlayerFromVehicle(playerid);
}
else if(IsAAZTCar(vehicleid) && IsPlayerAMemberOf(playerid) != 5)
{
format(string,sizeof(string),"You can't drive this vehicle because you are not a member of the Aztecas Gang!");
SendClientMessage(playerid, COLOR_LIGHTRED, string);
RemovePlayerFromVehicle(playerid);
}
else if(IsAVAGCar(vehicleid) && IsPlayerAMemberOf(playerid) != 6)
{
format(string,sizeof(string),"You can't drive this vehicle because you are not a member of the Vagos Gang!");
SendClientMessage(playerid, COLOR_LIGHTRED, string);
RemovePlayerFromVehicle(playerid);
}
else if(IsAHCar(vehicleid) && IsPlayerAMemberOf(playerid) != 7)
{
format(string,sizeof(string),"You can't drive this vehicle because you are not a member of the Hitmen Agency");
SendClientMessage(playerid, COLOR_LIGHTRED, string);
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}