Advertisement
Eduardo_efu

Sistema Chaleco en cuerpo v2

Jan 1st, 2018
2,055
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. /*
  2. Sistema Chaleco en cuerpo" by Eduardo_1 ($moke).
  3. Funciones:
  4. • Al morir, salir se le quita el objeto.
  5. • Si el jugador no tiene chaleco para tiene la función "TieneChaleco" activada se le quitará el objeto.
  6. • Si el jugadot tiene chaleco pero no tiene la función activada, esta se le activará y agregará el objeto.
  7. NO BORRES CRÉDITOS, RESPETA EL TRABAJO DE LOS DEMÁS.
  8. */
  9. #include <a_samp>
  10. #include <zcmd>
  11. new bool:TieneChaleco[MAX_PLAYERS];
  12. public OnPlayerConnect(playerid)
  13. {
  14. TieneChaleco[playerid] = false;
  15. return 1;
  16. }
  17. public OnPlayerDisconnect(playerid, reason)
  18. {
  19. if(TieneChaleco[playerid] == true)
  20. {
  21. TieneChaleco[playerid] = false;
  22. RemovePlayerAttachedObject(playerid, 0);
  23. }
  24. return 1;
  25. }
  26. public OnPlayerDeath(playerid, killerid, reason)
  27. {
  28. if(TieneChaleco[playerid] == true)
  29. {
  30. TieneChaleco[playerid] = false;
  31. RemovePlayerAttachedObject(playerid, 0);
  32. }
  33. return 1;
  34. }
  35. public OnPlayerUpdate(playerid)
  36. {
  37. static Float:Chaleco;
  38. GetPlayerArmour(playerid, Chaleco);
  39. if(Chaleco != 0 && TieneChaleco[playerid] == false)
  40. {
  41. TieneChaleco[playerid] = true;
  42. SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.098, 0.039);
  43. }
  44. else if(Chaleco == 0 && TieneChaleco[playerid] == true)
  45. {
  46. TieneChaleco[playerid] = false;
  47. RemovePlayerAttachedObject(playerid, 0);
  48. }
  49. return 1;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement