#1

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(playeridissueridFloat:amountweaponid)
{
    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(issueridGetPlayerWantedLevel(issuerid) + 4);
                
SetPlayerColor(issueridCOLOR_ORANGE);
                
SendClientMessage(issueridCOLOR_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"50005);
                
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"300000"i"issuerid);
                
PushingPoliceMan[issuerid] = -1;
                
PlayerPlaySound(issuerid158670.0,0.0,5.0);
                
format(fstr2sizeof(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, -1fstr2);
                
PlayerPlaySound(playerid96390.0,0.0,5.0);
                
format(fstrsizeof(fstr), "[WANTED INCREASED]: Player %s(%d) his wanted level are increased because he Pushing / Shooting %s(%d)."TargetName(issuerid), issueridGetName(playerid), playerid);
                
CopRadio(COLOR_DODGERBLUEfstr);
                return 
1;
            }
            case 
1:
            {
                new 
Float:HP;
                if(
PoliceTeam(GetPlayerSkin(playerid)) && !SWAT(GetPlayerSkin(playerid)) && !Army(GetPlayerSkin(playerid)) && !FBII(GetPlayerSkin(playerid)) && !CIA(GetPlayerSkin(playerid)))
                
GetPlayerHealth(playeridHP);
                
PlayerPlaySound(playerid108050.0,0.0,5.0);
                
SetPlayerHealth(playeridHP-0); // Get the weapon wich he got damaged and set the damage to 0.
                
PlayerPlaySound(issuerid70470.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(playeridHP);
                
PlayerPlaySound(playerid108050.0,0.0,5.0);
                
SetPlayerHealth(playeridHP-0); // Get the weapon wich he got damaged and set the damage to 0.
                
PlayerPlaySound(issuerid70470.0,0.0,5.0);
                return 
1;
            }
        }
    }
    return 
1;

Reply
#2

Hey Sir!

PHP код:
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponid)
{
    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(issueridGetPlayerWantedLevel(issuerid) + 4);
                    
SetPlayerColor(issueridCOLOR_ORANGE);
                    
SendClientMessage(issueridCOLOR_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"50005);
                    
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"300000"i"issuerid);
                    
PushingPoliceMan[issuerid] = -1;
                    
PlayerPlaySound(issuerid158670.0,0.0,5.0);
                    
format(fstr2sizeof(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, -1fstr2);
                    
PlayerPlaySound(playerid96390.0,0.0,5.0);

                    
format(fstrsizeof(fstr), "[WANTED INCREASED]: Player %s(%d) his wanted level are increased because he Pushing / Shooting %s(%d)."TargetName(issuerid), issueridGetName(playerid), playerid);
                    
CopRadio(COLOR_DODGERBLUEfstr);
                    return 
1;
                }
                case 
1:
                {
                    new 
Float:HP;
                    if(
PoliceTeam(GetPlayerSkin(playerid)) && !SWAT(GetPlayerSkin(playerid)) && !Army(GetPlayerSkin(playerid)) && !FBII(GetPlayerSkin(playerid)) && !CIA(GetPlayerSkin(playerid)))
                    
GetPlayerHealth(playeridHP);
                    
PlayerPlaySound(playerid108050.0,0.0,5.0);
                    
SetPlayerHealth(playeridHP-0); // Get the weapon wich he got damaged and set the damage to 0.
                    
PlayerPlaySound(issuerid70470.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(playeridHP);
                    
PlayerPlaySound(playerid108050.0,0.0,5.0);
                    
SetPlayerHealth(playeridHP-0); // Get the weapon wich he got damaged and set the damage to 0.
                    
PlayerPlaySound(issuerid70470.0,0.0,5.0);
                    return 
1;
                }
            }
        }
    }
    return 
1;

Try it.
Reply
#3

No. Use the switch for your variable gTeam because switching issuerid makes no sense.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)