Advertisement
MarkoGamer123

Eve snow sistem

Dec 10th, 2020
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. #include <a_samp>
  2. #include <streamer>
  3. #include <foreach>
  4.  
  5. new snowobj[MAX_PLAYERS];
  6. new SnowONOFF[MAX_PLAYERS];
  7. new Float:sx,Float:sy,Float:sz;
  8.  
  9. public OnPlayerSpawn(playerid)
  10. {
  11. SnowONOFF[playerid]=1;
  12. snowobj[playerid]=CreatePlayerObject(playerid,18864, sx, sy, sz, 0.0, 0.0, 0.0, 300.0);
  13. return 1;
  14. }
  15.  
  16. public OnPlayerDisconnect(playerid, reason)
  17. {
  18. if(SnowONOFF[playerid]==1)
  19. {
  20. DestroyPlayerObject(playerid,snowobj[playerid]);
  21. }
  22. return 1;
  23. }
  24.  
  25. public OnPlayerUpdate(playerid)
  26. {
  27. if(SnowONOFF[playerid]==1)
  28. {
  29. GetPlayerCameraPos(playerid,sx,sy,sz);
  30. MovePlayerObject(playerid,snowobj[playerid],sx,sy,sz,9999.0);
  31. }
  32. if(GetPlayerInterior(playerid) > 0)
  33. {
  34. DestroyPlayerObject(playerid,snowobj[playerid]);
  35. }
  36. if(GetPlayerVirtualWorld(playerid) > 0)
  37. {
  38. DestroyPlayerObject(playerid,snowobj[playerid]);
  39. }
  40. return 1;
  41. }
  42.  
  43. public OnPlayerInteriorChange(playerid,newinteriorid,oldinteriorid)
  44. {
  45. if(newinteriorid > 0)
  46. {
  47. SnowONOFF[playerid]=1;
  48. snowobj[playerid]=CreatePlayerObject(playerid,18864, sx, sy, sz-5, 0.0, 0.0, 0.0, 300.0);
  49. }
  50. else if(newinteriorid == 0)
  51. {
  52. SnowONOFF[playerid]=1;
  53. snowobj[playerid]=CreatePlayerObject(playerid,18864, sx, sy, sz-5, 0.0, 0.0, 0.0, 300.0);
  54. }
  55. return 1;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement