A warning (Rep+)
#1

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid) {
    if(pTazer[playerid] == 1 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && weaponid == 23 && amount > 10)
    {
        if(TazerTimeout[playerid] > 0) return true;
        if(PlayerCuffed[damagedid] == 0 && GetPlayerState(damagedid) == PLAYER_STATE_ONFOOT && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(damagedid))) {
            new
                Float:X,
                Float:Y,
                Float:Z,
                string[128];
            GetPlayerPos(playerid, X, Y, Z);

            if(!IsPlayerInRangeOfPoint(damagedid, 18.5, X, Y, Z))
                return SendClientMessage(playerid, COLOR_GRAD2, "Your tazer can't reach that far!");

            if(AdminDuty[damagedid] == 1 && GetPVarInt(damagedid, "AdminUndercover") == 0)
                return SendClientMessage(playerid, COLOR_GRAD2, "Admins can't be tazed!");

            if(GetPVarInt(damagedid, "Injured") == 1)
                return SendClientMessage(playerid, COLOR_GREY, "You can't taze injured people.");

            if(GetPlayerWeapon(damagedid) != 0 && !IsACop(damagedid)) {
                format(string, sizeof(string), "{AA3333}AdmWarning:{FFFF00} %s (ID %d) has possibly just rush tazed %s (ID %d).", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(damagedid), damagedid);
                ABroadCast(COLOR_YELLOW, string, 1);
            }

            format(string, sizeof(string), "* %s fires their tazer at %s, stunning them.", GetPlayerNameEx(playerid), GetPlayerNameEx(damagedid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            GameTextForPlayer(damagedid, "~r~Tazed", 3500, 3);
            TogglePlayerControllable(damagedid, 0);
            ApplyAnimation(damagedid,"CRACK","crckdeth2",4.1,0,1,1,1,1,1);
            GetPlayerPos(damagedid, X, Y, Z);
            PlayerPlaySound(damagedid, 1085, X, Y, Z);
            PlayerPlaySound(playerid, 1085, X, Y, Z);
            PlayerCuffed[damagedid] = 1;
            SetPVarInt(damagedid, "PlayerCuffed", 1);
            PlayerCuffedTime[damagedid] = 16;
            SetPVarInt(damagedid, "IsFrozen", 1);
            TazerTimeout[playerid] = 4;
            SetTimerEx("TazerTimer",1000,false,"d",playerid);
            GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~r~Tazer reloading... ~w~5", 1500,3);
            return true;
        }
    }
    if(pBeanBag[playerid] == 1 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && weaponid == 25 && amount > 10)
    {
        new Float:currenthp;
        GetPlayerHealth(damagedid, currenthp);

        if((currenthp + amount) >= 100.0) SetPlayerHealth(damagedid, 100.0); else SetPlayerHealth(damagedid, (currenthp + amount));

        if(BeanBagTimeout[playerid] > 0) return true;
        if(PlayerCuffed[damagedid] == 0 && GetPlayerState(damagedid) == PLAYER_STATE_ONFOOT && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(damagedid))) {
            new
                Float:X,
                Float:Y,
                Float:Z,
                string[128];
            GetPlayerPos(playerid, X, Y, Z);

            if(!IsPlayerInRangeOfPoint(damagedid, 18.5, X, Y, Z))
                return SendClientMessage(playerid, COLOR_GRAD2, "Your bean bag shotgun can't reach that far!");

            if(AdminDuty[damagedid] == 1 && GetPVarInt(damagedid, "AdminUndercover") == 0)
                return SendClientMessage(playerid, COLOR_GRAD2, "Admins can't be bean bagged!");

            if(GetPVarInt(damagedid, "Injured") == 1)
                return SendClientMessage(playerid, COLOR_GREY, "You can't bean bag injured people.");

            if(GetPlayerWeapon(damagedid) != 0 && !IsACop(damagedid)) {
                format(string, sizeof(string), "{AA3333}AdmWarning:{FFFF00} %s (ID %d) has possibly just rush bean bagged %s (ID %d).", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(damagedid), damagedid);
                ABroadCast(COLOR_YELLOW, string, 1);
            }

                // Cuffed bitch.
                TogglePlayerControllable(damagedid, 0);
                PlayerCuffed[damagedid] = 1;
                SetPVarInt(damagedid, "PlayerCuffed", 1);
                PlayerCuffedTime[damagedid] = 16;
            }
            return true;
        }
} //Here is line 52635
PHP код:
C:\Users\TEST\Downloads\LYL11 (3).pwn(52635) : warning 209: function "OnPlayerGiveDamage" should return a value
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
1 Warning

How to fix it?
Reply


Messages In This Thread
A warning (Rep+) - by Wayland - 17.01.2014, 10:18
Re: A warning (Rep+) - by $Marco$ - 17.01.2014, 10:22
Re: A warning (Rep+) - by ProjectMan - 17.01.2014, 10:22
Re: A warning (Rep+) - by Wayland - 17.01.2014, 10:24
Re: A warning (Rep+) - by [FSaF]Jarno - 17.01.2014, 10:29
Re: A warning (Rep+) - by Wayland - 17.01.2014, 10:33

Forum Jump:


Users browsing this thread: 2 Guest(s)