Cases -
Thanks - 05.02.2019
What the problem here??
Errors #Case:
Код:
: error 014: invalid statement; not in switch
warning 215: expression has no effect
error 001: expected token: ";", but found ":"
error 029: invalid expression, assumed zero
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID) /// If not self-inflicted
{
if(gTeam[issuerid] != PoliceTeam(GetPlayerSkin(playerid)) && !SWAT(GetPlayerSkin(playerid)) && !Army(GetPlayerSkin(playerid)) && !FBII(GetPlayerSkin(playerid)) && !CIA(GetPlayerSkin(playerid))) // If we wasn't in the team of the guys who damage him.
{
case 0:
{
SetPlayerWantedLevel(issuerid, GetPlayerWantedLevel(issuerid) + 4);
SetPlayerColor(issuerid, COLOR_ORANGE);
SendClientMessage(issuerid, COLOR_ORANGE, "{FF8300}[WANTED LEVEL INCREASED]: YOU PUSHING A POLICE MAN AND YOUR WANTED LEVEL ARE INCREASED +4.");
GameTextForPlayer(issuerid, "~R~RUN~G~RUN~P~RUN", 5000, 5);
SendClientMessage(issuerid, -1, "{FF0000}NOTE: {FFFFFF}If you think it was a abuse pushing by the Police Please {FF0000}/complain(/c) {FFFFFF}him.");
PushingPoliceMan[issuerid] = SetTimerEx("ResetPushingPoliceMan", 30000, 0, "i", issuerid);
PushingPoliceMan[issuerid] = -1;
PlayerPlaySound(issuerid, 15867, 0.0,0.0,5.0);
format(fstr2, sizeof(fstr2), "{FF8300}[INCREASED]: {FFFFFF}Player {0080FF}%s(%d) {FFFFFF}his wanted level are {FF8300}INCREASED {FFFFFF}because he pushing/shooting you!!!",TargetName(issuerid), issuerid);
SendClientMessage(playerid, -1, fstr2);
PlayerPlaySound(playerid, 9639, 0.0,0.0,5.0);
format(fstr, sizeof(fstr), "[WANTED INCREASED]: Player %s(%d) his wanted level are increased because he Pushing / Shooting %s(%d).", TargetName(issuerid), issuerid, GetName(playerid), playerid);
CopRadio(COLOR_DODGERBLUE, fstr);
return 1;
}
case 1:
{
new Float:HP;
if(PoliceTeam(GetPlayerSkin(playerid)) && !SWAT(GetPlayerSkin(playerid)) && !Army(GetPlayerSkin(playerid)) && !FBII(GetPlayerSkin(playerid)) && !CIA(GetPlayerSkin(playerid)))
GetPlayerHealth(playerid, HP);
PlayerPlaySound(playerid, 10805, 0.0,0.0,5.0);
SetPlayerHealth(playerid, HP-0); // Get the weapon wich he got damaged and set the damage to 0.
PlayerPlaySound(issuerid, 7047, 0.0,0.0,5.0);
return 1;
}
case 2:
{
new Float:HP;
if(FireFighter(GetPlayerSkin(issuerid)) != PoliceTeam(GetPlayerSkin(playerid)) && !SWAT(GetPlayerSkin(playerid)) && !Army(GetPlayerSkin(playerid)) && !FBII(GetPlayerSkin(playerid)) && !CIA(GetPlayerSkin(playerid)))
GetPlayerHealth(playerid, HP);
PlayerPlaySound(playerid, 10805, 0.0,0.0,5.0);
SetPlayerHealth(playerid, HP-0); // Get the weapon wich he got damaged and set the damage to 0.
PlayerPlaySound(issuerid, 7047, 0.0,0.0,5.0);
return 1;
}
}
}
return 1;
}
Re: Cases -
RedRex - 05.02.2019
Hey Sir!
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID) /// If not self-inflicted
{
if(gTeam[issuerid] != PoliceTeam(GetPlayerSkin(playerid)) && !SWAT(GetPlayerSkin(playerid)) && !Army(GetPlayerSkin(playerid)) && !FBII(GetPlayerSkin(playerid)) && !CIA(GetPlayerSkin(playerid))) // If we wasn't in the team of the guys who damage him.
{
switch(issuerid)
{
case 0:
{
SetPlayerWantedLevel(issuerid, GetPlayerWantedLevel(issuerid) + 4);
SetPlayerColor(issuerid, COLOR_ORANGE);
SendClientMessage(issuerid, COLOR_ORANGE, "{FF8300}[WANTED LEVEL INCREASED]: YOU PUSHING A POLICE MAN AND YOUR WANTED LEVEL ARE INCREASED +4.");
GameTextForPlayer(issuerid, "~R~RUN~G~RUN~P~RUN", 5000, 5);
SendClientMessage(issuerid, -1, "{FF0000}NOTE: {FFFFFF}If you think it was a abuse pushing by the Police Please {FF0000}/complain(/c) {FFFFFF}him.");
PushingPoliceMan[issuerid] = SetTimerEx("ResetPushingPoliceMan", 30000, 0, "i", issuerid);
PushingPoliceMan[issuerid] = -1;
PlayerPlaySound(issuerid, 15867, 0.0,0.0,5.0);
format(fstr2, sizeof(fstr2), "{FF8300}[INCREASED]: {FFFFFF}Player {0080FF}%s(%d) {FFFFFF}his wanted level are {FF8300}INCREASED {FFFFFF}because he pushing/shooting you!!!",TargetName(issuerid), issuerid);
SendClientMessage(playerid, -1, fstr2);
PlayerPlaySound(playerid, 9639, 0.0,0.0,5.0);
format(fstr, sizeof(fstr), "[WANTED INCREASED]: Player %s(%d) his wanted level are increased because he Pushing / Shooting %s(%d).", TargetName(issuerid), issuerid, GetName(playerid), playerid);
CopRadio(COLOR_DODGERBLUE, fstr);
return 1;
}
case 1:
{
new Float:HP;
if(PoliceTeam(GetPlayerSkin(playerid)) && !SWAT(GetPlayerSkin(playerid)) && !Army(GetPlayerSkin(playerid)) && !FBII(GetPlayerSkin(playerid)) && !CIA(GetPlayerSkin(playerid)))
GetPlayerHealth(playerid, HP);
PlayerPlaySound(playerid, 10805, 0.0,0.0,5.0);
SetPlayerHealth(playerid, HP-0); // Get the weapon wich he got damaged and set the damage to 0.
PlayerPlaySound(issuerid, 7047, 0.0,0.0,5.0);
return 1;
}
case 2:
{
new Float:HP;
if(FireFighter(GetPlayerSkin(issuerid)) != PoliceTeam(GetPlayerSkin(playerid)) && !SWAT(GetPlayerSkin(playerid)) && !Army(GetPlayerSkin(playerid)) && !FBII(GetPlayerSkin(playerid)) && !CIA(GetPlayerSkin(playerid)))
GetPlayerHealth(playerid, HP);
PlayerPlaySound(playerid, 10805, 0.0,0.0,5.0);
SetPlayerHealth(playerid, HP-0); // Get the weapon wich he got damaged and set the damage to 0.
PlayerPlaySound(issuerid, 7047, 0.0,0.0,5.0);
return 1;
}
}
}
}
return 1;
}
Try it.
Re: Cases -
TheToretto - 06.02.2019
No. Use the switch for your variable gTeam because switching issuerid makes no sense.