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)
{
else if(IsACopCar(vehicleid))
{
if(!IsACop(playerid))
{
displayCenterHUDInfo(playerid, "You are not a member of the~n~~b~LSPD/FBI/SAST~w~.", 8);
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
ClearAnimations(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;
}
stock IsACop(playerid)
{
if(IsPlayerConnected(playerid))
{
new leader = PlayerInfo[playerid][pLeader];
new member = PlayerInfo[playerid][pMember];
if(member==1 || member==2 || member==3)
{
return 1;
}
else if(leader==1 || leader==2 || leader==3)
{
return 1;
}
else if(IsAnAgent(playerid))
{
return 1;
}
}
return 0;
}
stock IsACopCar(vehicleid)
{
for(new i; i<50; i++)
{
if(vehicleid == FacInfo[1][fCars][i])return 1;
}
return 0;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
{
}
}
else if(IsACopCar(vehicleid)) { if(IsACop(playerid)) { //other codes } }
else if(!IsACopCar(vehicleid)) { if(IsACop(playerid)) { //other codes } }
if(IsACop(playerid))
if(!IsACop(playerid))
else 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(!IsACopCar(vehicleid)) { if(IsACop(playerid) { //if he he not a cop your codes } }
What are you talking about Cruse? The exclamation mark represents a false or negative value.
if(!variable) Means 'variable' is either 0 or less, or is false. if(variable) Means 'variable' is greater than 0, or true. You have everything in reverse... |