03.03.2011, 19:25
Hello . I have a carmission script that randomly spawns a car and if you take and deliver it you recieve an ammount of money and +1 exp. The problem is that you become wanted player. I want to add if a player is TEAM_COP to do not be able to get in that car, I mean if he gets in it to be ejected from it and to say that : You are a cop you must defend it from stealers. Help me please because idk how to add it. If you need something else or didn't understand feel free to ask me. Here is the code :
pawn Код:
if(MissionActive == 2)
{
if(PlayerIsDoingMission == INVALID_PLAYER_ID)
{
ResetMissions();
if(city == 1){SearchedVehicle = MAX_HOUSES+random(sizeof(RandomVehicles_LS)-MAX_HOUSES);} // Avoid housecars and planes can be 'searched'
RandomCarMissionMoney = MinCarMissionMoney+random(MaxCarMissionMoney-MinCarMissionMoney);
format(string, sizeof(string), "Mission: Car Export! Find the %s at the red marker, Worth: %d$", VehicleName[GetVehicleModel(SearchedVehicle)-400], RandomCarMissionMoney);
SendClientMessageToAll(COLOR_YELLOW, string);
new Float:vehx, Float:vehy, Float:vehz;
new Float:ratio = 4.0;
GetVehiclePos(SearchedVehicle, vehx, vehy, vehz);
for(new i=0; i<MAX_SLOTS; i++)
{
SetPlayerCheckpoint(i, vehx, vehy, vehz, ratio); // lemme see
romeo[i]= 1;
if(!IsPlayerInVehicle(i, SearchedVehicle))
{
SetVehicleParamsForPlayer(SearchedVehicle, i, 1, 0);
}
else
{
SetVehicleParamsForPlayer(SearchedVehicle, i, 0, 0);
}
}
AllPlaySound(1139);
}
}