SA-MP Forums Archive
ZCMD ? - 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: ZCMD ? (/showthread.php?tid=349422)



ZCMD ? - N0FeaR - 08.06.2012

Error i get
Код:
../gamemodes/OnPlayerCommandZCMD.pwn(3404) : warning 217: loose indentation
../gamemodes/OnPlayerCommandZCMD.pwn(3420) : error 029: invalid expression, assumed zero
../gamemodes/OnPlayerCommandZCMD.pwn(3421) : warning 217: loose indentation
../gamemodes/OnPlayerCommandZCMD.pwn(3424) : warning 217: loose indentation
../gamemodes/OnPlayerCommandZCMD.pwn(3450) : warning 217: loose indentation


pawn Код:
}
COMMAND:revive(playerid, params[])
{
    if(PlayerCuffed[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "You can not do this while cuffed."); return 1; }
    if(Died[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead."); return 1; }
    if(MedicOnDuty[playerid] == 1 || PlayerInfo[playerid][pAdministrator] >= 1)
    {
        if(!strlen(params))
        {
               SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /revive [playerid/partofname]");
               return 1;
            }
            giveplayerid = ReturnUser(params);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    if(giveplayerid == playerid)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "You can not revive yourself");
                        return 1;
                    }
                    if(Died[giveplayerid] == 0)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "  This player is not Died");
                        return 1;
                    }
                    if(MedicOnDuty[playerid] == 0)
                    }
                       SendClientMessage(playerid, COLOR_GREY, "  You are not a medic on-duty");
                       return 1;
                    }
                    if (ProxDetectorS(2.5, playerid, giveplayerid))
                    {
                        Died[giveplayerid] = 0;
                        TogglePlayerControllable(giveplayerid, 1);
                        ApplyAnimation(giveplayerid, "CARRY", "crry_prtial", 2.0, 0, 0, 0, 0, 0);
                        TogglePlayerControllable(giveplayerid, 1);
                        PlayerInfo[giveplayerid][pDeath] = 0;
                        SendClientMessage(playerid, COLOR_GRAD2, "  You need to be closer to the player.");
                        if(PlayerInfo[playerid][pSex] == 1)
                        {
                            PlayerPlayerActionMessage(playerid,giveplayerid,20.0,"uses his defibrillator on");
                        } else {
                            PlayerPlayerActionMessage(playerid,giveplayerid,20.0,"uses her defibrillator on");
                        }
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "Playerid is not an active playerid");
                }
             }
             else
             {
                SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
            }
            return 1;
}



Re: ZCMD ? - SnG.Scot_MisCuDI - 08.06.2012

warning 217: loose indentation
And i dont know what line the error is.


Re: ZCMD ? - Dubya - 08.06.2012

pawn Код:
CMD:revive(playerid, params[])
{
    if(PlayerCuffed[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "You can not do this while cuffed."); return 1; }
    if(Died[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead."); return 1; }
    if(MedicOnDuty[playerid] == 1 || PlayerInfo[playerid][pAdministrator] >= 1)
    {
        if(!strlen(params))
        {
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /revive [playerid/partofname]");
            return 1;
        }
        giveplayerid = ReturnUser(params);
        if(IsPlayerConnected(giveplayerid))
        {
            if(giveplayerid != INVALID_PLAYER_ID)
            {
                if(giveplayerid == playerid)
                {
                    SendClientMessage(playerid, COLOR_GREY, "You can not revive yourself");
                    return 1;
                }
                if(Died[giveplayerid] == 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "  This player is not Died");
                    return 1;
                }
                if(MedicOnDuty[playerid] == 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "  You are not a medic on-duty");
                    return 1;
                }
                if (ProxDetectorS(2.5, playerid, giveplayerid))
                {
                    Died[giveplayerid] = 0;
                    TogglePlayerControllable(giveplayerid, 1);
                    ApplyAnimation(giveplayerid, "CARRY", "crry_prtial", 2.0, 0, 0, 0, 0, 0);
                    TogglePlayerControllable(giveplayerid, 1);
                    PlayerInfo[giveplayerid][pDeath] = 0;
                    SendClientMessage(playerid, COLOR_GRAD2, "  You need to be closer to the player.");
                    if(PlayerInfo[playerid][pSex] == 1)
                    {
                        PlayerPlayerActionMessage(playerid,giveplayerid,20.0,"uses his defibrillator on");
                    }
                    else
                    {
                        PlayerPlayerActionMessage(playerid,giveplayerid,20.0,"uses her defibrillator on");
                    }
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "Playerid is not an active playerid");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
            }
            return 1;
        }
    }
}



Re: ZCMD ? - N0FeaR - 08.06.2012

there you go.
pawn Код:
}
COMMAND:revive(playerid, params[])
{
    if(PlayerCuffed[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "You can not do this while cuffed."); return 1; }
    if(Died[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead."); return 1; }
    if(MedicOnDuty[playerid] == 1 || PlayerInfo[playerid][pAdministrator] >= 1)
    {
        if(!strlen(params))
        {
               SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /revive [playerid/partofname]");
               return 1;
            }
           line 3404 giveplayerid = ReturnUser(params);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    if(giveplayerid == playerid)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "You can not revive yourself");
                        return 1;
                    }
                    if(Died[giveplayerid] == 0)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "  This player is not Died");
                        return 1;
                    }
                    if(MedicOnDuty[playerid] == 0)
                   line 3420 }
                    line 3421   SendClientMessage(playerid, COLOR_GREY, "  You are not a medic on-duty");
                       return 1;
                    }
               line 3424     if (ProxDetectorS(2.5, playerid, giveplayerid))
                    {
                        Died[giveplayerid] = 0;
                        TogglePlayerControllable(giveplayerid, 1);
                        ApplyAnimation(giveplayerid, "CARRY", "crry_prtial", 2.0, 0, 0, 0, 0, 0);
                        TogglePlayerControllable(giveplayerid, 1);
                        PlayerInfo[giveplayerid][pDeath] = 0;
                        SendClientMessage(playerid, COLOR_GRAD2, "  You need to be closer to the player.");
                        if(PlayerInfo[playerid][pSex] == 1)
                        {
                            PlayerPlayerActionMessage(playerid,giveplayerid,20.0,"uses his defibrillator on");
                        } else {
                            PlayerPlayerActionMessage(playerid,giveplayerid,20.0,"uses her defibrillator on");
                        }
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "Playerid is not an active playerid");
                }
             }
             else
             {
                SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
            }
            line 3450return 1;
}



Re: ZCMD ? - N0FeaR - 09.06.2012

Quote:
Originally Posted by Dubya
Посмотреть сообщение
pawn Код:
CMD:revive(playerid, params[])
{
    if(PlayerCuffed[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "You can not do this while cuffed."); return 1; }
    if(Died[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead."); return 1; }
    if(MedicOnDuty[playerid] == 1 || PlayerInfo[playerid][pAdministrator] >= 1)
    {
        if(!strlen(params))
        {
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /revive [playerid/partofname]");
            return 1;
        }
        giveplayerid = ReturnUser(params);
        if(IsPlayerConnected(giveplayerid))
        {
            if(giveplayerid != INVALID_PLAYER_ID)
            {
                if(giveplayerid == playerid)
                {
                    SendClientMessage(playerid, COLOR_GREY, "You can not revive yourself");
                    return 1;
                }
                if(Died[giveplayerid] == 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "  This player is not Died");
                    return 1;
                }
                if(MedicOnDuty[playerid] == 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "  You are not a medic on-duty");
                    return 1;
                }
                if (ProxDetectorS(2.5, playerid, giveplayerid))
                {
                    Died[giveplayerid] = 0;
                    TogglePlayerControllable(giveplayerid, 1);
                    ApplyAnimation(giveplayerid, "CARRY", "crry_prtial", 2.0, 0, 0, 0, 0, 0);
                    TogglePlayerControllable(giveplayerid, 1);
                    PlayerInfo[giveplayerid][pDeath] = 0;
                    SendClientMessage(playerid, COLOR_GRAD2, "  You need to be closer to the player.");
                    if(PlayerInfo[playerid][pSex] == 1)
                    {
                        PlayerPlayerActionMessage(playerid,giveplayerid,20.0,"uses his defibrillator on");
                    }
                    else
                    {
                        PlayerPlayerActionMessage(playerid,giveplayerid,20.0,"uses her defibrillator on");
                    }
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "Playerid is not an active playerid");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
            }
            return 1;
        }
    }
}
only this now

../gamemodes/OnPlayerCommandZCMD.pwn(3454) : warning 209: function "cmd_revive" should return a value


Re: ZCMD ? - Dubya - 09.06.2012

Ok, I forgot a return 1;
pawn Код:
CMD:revive(playerid, params[])
{
    if(PlayerCuffed[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "You can not do this while cuffed."); return 1; }
    if(Died[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead."); return 1; }
    if(MedicOnDuty[playerid] == 1 || PlayerInfo[playerid][pAdministrator] >= 1)
    {
        if(!strlen(params))
        {
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /revive [playerid/partofname]");
            return 1;
        }
        giveplayerid = ReturnUser(params);
        if(IsPlayerConnected(giveplayerid))
        {
            if(giveplayerid != INVALID_PLAYER_ID)
            {
                if(giveplayerid == playerid)
                {
                    SendClientMessage(playerid, COLOR_GREY, "You can not revive yourself");
                    return 1;
                }
                if(Died[giveplayerid] == 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "  This player is not Died");
                    return 1;
                }
                if(MedicOnDuty[playerid] == 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "  You are not a medic on-duty");
                    return 1;
                }
                if (ProxDetectorS(2.5, playerid, giveplayerid))
                {
                    Died[giveplayerid] = 0;
                    TogglePlayerControllable(giveplayerid, 1);
                    ApplyAnimation(giveplayerid, "CARRY", "crry_prtial", 2.0, 0, 0, 0, 0, 0);
                    TogglePlayerControllable(giveplayerid, 1);
                    PlayerInfo[giveplayerid][pDeath] = 0;
                    SendClientMessage(playerid, COLOR_GRAD2, "  You need to be closer to the player.");
                    if(PlayerInfo[playerid][pSex] == 1)
                    {
                        PlayerPlayerActionMessage(playerid,giveplayerid,20.0,"uses his defibrillator on");
                    }
                    else
                    {
                        PlayerPlayerActionMessage(playerid,giveplayerid,20.0,"uses her defibrillator on");
                    }
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "Playerid is not an active playerid");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
            }
            return 1;
        }
    }
    return 1;
}