Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. public OnPlayerCommandText(playerid, cmdtext[])
  2. {
  3. if (strcmp("/bite", cmdtext, true, 10) == 0)
  4. {
  5. new Float:Infected[3];
  6. GetPlayerPos(playerid, Infected[0], Infected[1], Infected[2]);
  7. for (new H = 0; H < MAX_PLAYERS; H++)
  8. {
  9. if (H != playerid)
  10. {
  11. if (IsPlayerConnected(H))
  12. {
  13. if (IsPlayerInRangeOfPoint(H, 5.0, Infected[0], Infected[1], Infected[2]))
  14. {
  15. if (GetPlayerTeam(H) != 1)
  16. {
  17. SetPlayerHealth(H, 0);
  18. GameTextForPlayer(H, "You've been bitten.",10000,1);
  19. }
  20. } else {
  21. GameTextForPlayer(playerid,"There is anyone close enough to bite.",100,1);
  22. }
  23. } else {
  24. GameTextForPlayer(playerid,"There is anyone close enough to bite.",100,1);
  25. }
  26. }
  27. }
  28. }
  29. return 1;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement