01.05.2015, 08:08
(
Последний раз редактировалось Alpay0098; 01.05.2015 в 09:17.
)
Hi,
This code doesn't work. (except IsACopCar and IsTruckerCar) Does it have any problem?
This code doesn't work. (except IsACopCar and IsTruckerCar) Does it have any problem?
PHP код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new Float:x, Float:y, Float:z;
if(GetPlayerSurfingVehicleID(playerid) == vehicleid)
{
new Float:hp;
GetPlayerHealth(playerid,hp);
GetPlayerPos(playerid, x, y, z);
if(!PlayerInfo[playerid][pMask]) format(string, sizeof(string), "* %s slipped off the top of the vehicle and fell.", PlayerRPName(playerid));
else format(string, sizeof(string), "* Gharibe slipped off the top of the vehicle and fell.");
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerPos(playerid, x+3, y+3, z+1);
SetPlayerHealth(playerid,hp-3);
PlayerPlaySound(playerid, 1130, 0.0, 0.0, 0.0);
LoopingAnim(playerid,"PED","BIKE_fallR",4.0,0,1,1,1,0);
}
if(!ispassenger)
{
if(IsACopCar(vehicleid))
{
if(!IsACop(playerid))
{
displayCenterHUDInfo(playerid, "You are not a member of the~n~~b~LSPD/FBI/SAST~w~.", 8); //display for 8 seconds
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
ClearAnimations(playerid);
}
}
else if(IsTruckerCar(vehicleid))
{
if(PlayerInfo[playerid][pJob] != 18)
{
displayCenterHUDInfo(playerid, "You are not a~n~~r~Trucker Driver~w~.", 8); //display for 8 seconds
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
ClearAnimations(playerid);
}
else
{
CP[playerid] = CHECKPOINT_TRUCKERLOAD;
SetPlayerCheckpoint(playerid,1037.4570,-1105.8281,23.9771,4);
}
}
else if(IsADLTCar(vehicleid))
{
if(IsPlayerGivingDTest[playerid] == 0)
{
displayCenterHUDInfo(playerid, "Shoma hazineye Test ra pardakht nakardid!", 8); //display for 8 seconds
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
ClearAnimations(playerid);
}
else
{
CP[playerid] = CHECKPOINT_DLTSTART;
SetPlayerCheckpoint(playerid,1700.4584,-1589.6927,13.3699,4);
}
}
else if(IsANGCar(vehicleid))
{
if(!IsANG(playerid))
{
displayCenterHUDInfo(playerid, "You are not a member of the~n~~g~National Guard~w~.", 8); //display for 8 seconds
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
ClearAnimations(playerid);
}
}
else if(IsAFBICar(vehicleid))
{
if(!IsAFBI(playerid))
{
displayCenterHUDInfo(playerid, "You are not a member of the~n~~b~FBI~w~.", 8); //display for 8 seconds
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
ClearAnimations(playerid);
}
}
else if(IsATaxiCar(vehicleid) || IsABus(vehicleid))
{
if(PlayerInfo[playerid][pMember] != 10 && PlayerInfo[playerid][pJob] != 14)
{
displayCenterHUDInfo(playerid, "You are not a~n~~y~Taxi Driver~w~.", 8); //display for 8 seconds
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
}
}
else if(IsANewsCar(vehicleid))
{
if(PlayerInfo[playerid][pMember] != 9 && !IsAnAgent(playerid))
{
displayCenterHUDInfo(playerid, "You are not a member of the~n~~b~News Agency~w~.", 8); //display for 8 seconds
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
}
}
else if(IsAnAmbulance(vehicleid))
{
if(PlayerInfo[playerid][pMember] != 4 && !IsAnAgent(playerid))
{
displayCenterHUDInfo(playerid, "You are not a member of the~n~~r~LSMFD~w~.", 8); //display for 8 seconds
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
}
}
else if(IsAVipCar(vehicleid))
{
if(IsABronzeCar(vehicleid) && PlayerInfo[playerid][pDonateRank] <= 0)
{
displayCenterHUDInfo(playerid, "~w~You are not a~n~~y~Bronze ~p~VIP~w~.", 8); //display for 8 seconds
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
}
if(IsASilverCar(vehicleid) && PlayerInfo[playerid][pDonateRank] <= 1)
{
displayCenterHUDInfo(playerid, "~w~You are not a ~b~~h~~h~~h~Silver ~p~VIP~w~.", 8); //display for 8 seconds
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
}
if(IsAGoldCar(vehicleid) && PlayerInfo[playerid][pDonateRank] <= 2)
{
displayCenterHUDInfo(playerid, "~w~You are not a~n~~y~Gold ~p~VIP~w~.", 8); //display for 8 seconds
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
}
}
else if(RapidResKitActive[playerid] == 1)
{
if(!ispassenger || ispassenger)
{
SendClientMessage(playerid, COLOR_GREY, "You can't enter a vehicle while using a rapid response kit, '/droprrk' in order to drop it.");
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
}
}
for(new i = 0; i < 4; i++)
{
if(FacInfo[6][fCars][i] == vehicleid)
{
if(!IsASenate(playerid) && !IsAnAgent(playerid))
{
displayCenterHUDInfo(playerid, "You are not a member of the~n~~r~Senate~w~.", 8); //display for 8 seconds
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
}
}
}
}
new Model = GetVehicleModel(vehicleid);
if(Model == 427 && !ispassenger)
{
GetPlayerArmour(playerid, StoreArmour[playerid]);
}
else if(PlayerTied[playerid] != 0) { ClearAnimations(playerid); }
else if(PlayerCuffed[playerid] != 0) { ClearAnimations(playerid); }
else if(PlayerFrozen[playerid] != 0) { ClearAnimations(playerid); }
else if(RapidResKitActive[playerid] != 0) { ClearAnimations(playerid); }
else if(PlayerJustDied[playerid] != 0) { ClearAnimations(playerid); }
return 1;
}