Guest User

poljubac

a guest
Jan 1st, 2013
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3.  
  4. stock ArePlayersFacing(playerid, targetid) {
  5. new
  6. Float:angle1,
  7. Float:angle2,
  8. Float:difference
  9. ;
  10. GetPlayerFacingAngle(playerid, angle1);
  11. GetPlayerFacingAngle(targetid, angle2);
  12. if(angle1 > angle2) difference = angle1 - angle2;
  13. else difference = angle2 - angle1;
  14. if(difference < 190 && difference > 170) return 1;
  15. return 0;
  16. }
  17.  
  18. CMD:poljubac(playerid, params[]) {
  19. new id = strval(params);
  20. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000, #ERROR: Igrac nije online!);
  21. if(isnull(params)) return SendClientMessage(playerid, -1, #KORISTI: /poljubac [ID]);
  22. new
  23. Float:x,
  24. Float:y,
  25. Float:z
  26. ;
  27. GetPlayerPos(id, x, y, z);
  28. if(ArePlayersFacing(playerid, id) && IsPlayerInRangeOfPoint(playerid, 1.5, x, y, z)) {
  29. new
  30. string[128],
  31. aName[MAX_PLAYER_NAME],
  32. pName[MAX_PLAYER_NAME]
  33. ;
  34. GetPlayerName(playerid, aName, sizeof aName);
  35. GetPlayerName(id, pName, sizeof pName);
  36. ApplyAnimation(playerid, "KISSING", "Playa_Kiss_02", 10.0, 0, 0, 0, 0, 5000, 1);
  37. ApplyAnimation(id, "KISSING", "Playa_Kiss_02", 10.0, 0, 0, 0, 0, 5000, 1);
  38. format(string, sizeof string, #Dobili ste poljubac od %s!, aName);
  39. SendClientMessage(id, -1, string);
  40. format(string, sizeof string, #Poljubili ste %s!, pName);
  41. SendClientMessage(playerid, -1, string);
  42. }
  43. else SendClientMessage(playerid, 0xFF0000, #ERROR: Igrac kojeg zelite poljubiti nije kraj vas ili nije online!);
  44. return 1;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment