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.