16.05.2011, 18:02
I want to make player lose health when near object id 2908 kmb_deadhead
can somebody help me please
can somebody help me please
if(!strcmp("/nearobject",cmdtext)) { if(IsPlayerInRangeOfPoint(playerid, X, Y, Z)) // Object coords , get it ingame... { SetPlayerHealth(playerid, 0.0); } return 1; }
stock IsPlayerNearObject(playerid, objectid) { new Float:X, Float:Y, Float:Z; GetObjectPos(objectid, X, Y, Z); if(IsPlayerInRangeOfPoint(playerid, 10.0, X, Y, Z)) return 1; return 0; } Use... if(IsPlayerNearObject(playerid, 2908)) print("Player Is Near kmb_deadhead!");