Small /tazer bug +rep
#6

The codes of Skillet are pretty good but need modification:

Код:
if(newkeys & KEY_FIRE)
{
    if(GotTazer[playerid] == 1 && arrFaction[playerid][p_iMember] > 0)
    {
        new Float:x,Float:y,Float:z,giveplayerid,bool:result = false,i = -1;
        GetPlayerPos(playerid,x,y,z);
        while(i < MAX_PLAYERS)
        {
            i++;
            if(IsPlayerInRangeOfPoint(i,3.0,x,y,z) && i != playerid) //You were missing a closing )
            {
                giveplayerid = i;
                result = true;
                break;
            }
        }
        if(result == true)
        {
            if(ProxDetectorS(3.0, playerid,giveplayerid))
            {
                new string[128];
                TogglePlayerControllable(giveplayerid, 0);
                format(string, sizeof(string), "*%s stuns %s with the tazer.", GetPlayerNameEx(playerid),GetPlayerNameEx(giveplayerid));
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
                result = false;
                return 1;
            }
        }
        else return SendClientMessage(playerid, COLOR_WHITE, "No one is near you!");
    }
}
It's better where I placed i != playerid, because in the codes of Skillet, the result will always be playerid if he has a lower id then the victim.
Reply


Messages In This Thread
Small /tazer bug +rep - by RLGaming - 08.10.2012, 16:54
Re : Small /tazer bug +rep - by lelemaster - 08.10.2012, 17:24
Re: Small /tazer bug +rep - by RLGaming - 08.10.2012, 17:36
Re: Small /tazer bug +rep - by Riddick94 - 08.10.2012, 17:40
Re: Small /tazer bug +rep - by Skillet` - 08.10.2012, 17:44
Re : Re: Small /tazer bug +rep - by lelemaster - 08.10.2012, 17:53
Re: Re : Re: Small /tazer bug +rep - by Skillet` - 08.10.2012, 17:58
Re : Re: Re : Re: Small /tazer bug +rep - by lelemaster - 08.10.2012, 18:16
Re: Re : Re: Re : Re: Small /tazer bug +rep - by Skillet` - 08.10.2012, 22:20

Forum Jump:


Users browsing this thread: 1 Guest(s)