SA-MP Forums Archive
Help Unreachable Code - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help Unreachable Code (/showthread.php?tid=395788)



Help Unreachable Code - MoNsTeR_EnErGy - 27.11.2012

PHP код:
ocmd:wiederbeleben(playerid,params[])
{
    new 
idstring[128];
    if(
PlayerInfo[playerid][pMember]== 4||PlayerInfo[playerid][pLeader] == 4)
           return 
SendClientMessage(playeridROT,"Du bist kein Mitglied der Medics!");
    if(
sscanf(params"u"id))
        return 
SendClientMessage(playeridWeiЯ"Befehl: /wiederbeleben [Name/ID]");
    if(
id == INVALID_PLAYER_ID)
        return 
SendClientMessage(playeridROT"Dieser Spieler existiert nicht.");
    if(
PlayerInfo[id][pTot] == 0)
        return 
SendClientMessage(playerid,ROT,"Der angegebene Spieler ist nicht Tod!");
    if(
playerid == id)
        return 
SendClientMessage(playerid,ROT,"Du kannst dich nicht selbst wiederbelben!");
     if(
IsPlayerNPC(id))
          return 
SendClientMessage(playeridROT"Du kannst keinen NPC/Bot wiederbelben.");
       if(
IsPlayerInAnyVehicle(playerid))
        return 
SendClientMessage(playeridROT,"Du kannst keinen wiederbelben wдhrend du in oder auf einem Fahrzeug bist!");
    if(
IsPlayerInRangeOfPoint(playerid,3.0KadaverX[id],KadaverY[id],KadaverZ[id]))
    {
        
format(string128"Du hast %s erfolgreich wiederbelebt!",GetName(id));
        
SendClientMessage(playeridWeiЯstring);
        
format(string128"%s %s hat dich erfolgreich wiederbelebt!",pRank,GetName(playerid));
        
SendClientMessage(playeridGELB"Du bekommst 300Ђ fьr den nдchsten Zahltag gutgeschrieben");
        
SendClientMessage(idWeiЯstring);
        
PlayerInfo[id][pTot] = 0;
        
pIstTot[id] = 0;
        
SetCameraBehindPlayer(id);
        
SetPlayerVirtualWorld(id,0);
        
DeleteTotenkopf(id);
        
TogglePlayerControllable(id,true);
        
SetPlayerHealth(id,35.0);
         new 
Float:xP,Float:xY,Float:xZ;
        
GetPlayerPos(playeridxPxYxZ);
        
SetPlayerPos(id,xP,xY,xZ);
        return 
1;
    }
    else
    {
        
SendClientMessage(playerid,ROT,"Du bist bei keinem Leichnam!");
        return 
1;
    }
    return 
1;

PHP код:
warning 225unreachable code 
Please can you Help me.


Re: Help Unreachable Code - you10 - 27.11.2012

Remove the last return 1; as it will never be used.


AW: Help Unreachable Code - MoNsTeR_EnErGy - 27.11.2012

oh ok Thank you