I don't know what is wrong.
#3

Quote:
Originally Posted by FireCat
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/vbite", cmdtext, true))
    {
        new Float:x, Float:y, Float:z;
        new targetid = cmdtext[9];
        if(IsPlayerInRangeOfPoint(targetid,2.0,x,y,z)) return SendClientMessage(playerid,0xE00404,"You are not near the player");
        SetPlayerHealth(targetid,10);
        SendClientMessage(targetid,0xE00404,"You have been bitten by a vampire");
        SetPlayerDrunkLevel(playerid,3000);
        ApplyAnimation(playerid,"KISSING","Grlfrd_Kiss_01",4.1,0,0,0,0,1,1);
        return 1;
    }
    return 0;
}
x, y and z have no value rather than 0, so what's the use of position checking?
Also, there's no actual validation on the parameter that the player inserts.
Additionally, the error message will be sent when the target player IS near the coordinates. I don't think that's the desired behavior.
Reply


Messages In This Thread
I don't know what is wrong. - by TaLhA XIV - 31.07.2012, 19:42
Re: I don't know what is wrong. - by FireCat - 31.07.2012, 19:47
Re: I don't know what is wrong. - by AndreT - 31.07.2012, 19:49
Re: I don't know what is wrong. - by XStormiest - 31.07.2012, 19:50
Re: I don't know what is wrong. - by FireCat - 31.07.2012, 19:53
Re: I don't know what is wrong. - by Universal - 31.07.2012, 19:59
Re: I don't know what is wrong. - by TaLhA XIV - 31.07.2012, 20:08
Re: I don't know what is wrong. - by Universal - 31.07.2012, 20:12
Re: I don't know what is wrong. - by XStormiest - 31.07.2012, 20:12
Re: I don't know what is wrong. - by TaLhA XIV - 31.07.2012, 20:24

Forum Jump:


Users browsing this thread: 1 Guest(s)