contactmail

Untitled

Jul 29th, 2013
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. // Home filterscript by Sellize
  2. #define FILTERSCRIPT
  3.  
  4. #include <a_samp>
  5.  
  6. public OnFilterScriptInit()
  7. {
  8. print("Home by Sellize");
  9. return 1;
  10. }
  11.  
  12. public OnPlayerConnect(playerid)
  13. {
  14. SetPVarInt(playerid, "hashome", 0);
  15. return 1;
  16. }
  17.  
  18.  
  19. public OnPlayerCommandText(playerid, cmdtext[])
  20. {
  21. if(!strcmp(cmdtext, "/sethome", true))
  22. {
  23. new Float:x, Float:y, Float:z;
  24. SendClientMessage(playerid, 0x08BDC9FF, "Home set. Use /home to teleport back.");
  25. GetPlayerPos(playerid, x, y, z);
  26. SetPVarFloat(playerid, "xpos", x);
  27. SetPVarFloat(playerid, "ypos", y);
  28. SetPVarFloat(playerid, "zpos", z);
  29. SetPVarInt(playerid, "hashome", 1);
  30. return 1;
  31. }
  32. else if(!strcmp(cmdtext, "/home", true))
  33. {
  34. if(GetPVarInt(playerid, "hashome") == 1)
  35. {
  36. SendClientMessage(playerid, 0x08BDC9FF, "Teleported to home.");
  37. SetPlayerPos(playerid, GetPVarFloat(playerid, "xpos"), GetPVarFloat(playerid, "ypos"), GetPVarFloat(playerid, "zpos"));
  38. }
  39. else
  40. {
  41. SendClientMessage(playerid, 0x7F898AFF, "You need to set your home first, use /sethome.");
  42. }
  43. return 1;
  44. }
  45. return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment