Guest User

Save and load System Error

a guest
Mar 28th, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.86 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. #define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6.  
  7. #if defined FILTERSCRIPT
  8.  
  9. public OnFilterScriptInit()
  10. {
  11.     print("\n--------------------------------------");
  12.     print(" Save/Load Position System By Tox'");
  13.     print("--------------------------------------\n");
  14.     return 1;
  15. }
  16.  
  17. public OnFilterScriptExit()
  18. {
  19.     return 1;
  20. }
  21.  
  22. #else
  23.  
  24. main()
  25. {
  26.     print("\n----------------------------------");
  27.     print(" Blank Gamemode by your name here");
  28.     print("----------------------------------\n");
  29. }
  30.  
  31. #endif
  32.  
  33. public OnPlayerCommandText(playerid, cmdtext[])
  34. {
  35.     if(strcmp(cmdtext, "/s", true) ==0)
  36.     {
  37.     if(IsPlayerConnected(playerid))
  38.     {
  39.         new Float:x,Float:y,Float:z;
  40.         GetPlayerPos(playerid,x,y,z);
  41.         SetPVarFloat(playerid,"xpos",x); // save X POS
  42.         SetPVarFloat(playerid,"ypos",y); // save Y POS
  43.         SetPVarFloat(playerid,"zpos",z); // save Z POS
  44.         SetPVarInt(playerid,"int",GetPlayerInterior(playerid));//get interior
  45.         SendClientMessage(playerid,0x33AA33AA,"Position Saved! Use /r To Get back To It!,");
  46.     }
  47.     return 1;
  48. }
  49.     if (strcmp("/r", cmdtext, true, 10) == 0)
  50. {
  51.     if(IsPlayerConnected(playerid))
  52.     {
  53.         if (GetPlayerState(playerid) == 2)
  54.         {
  55.             new tmpcar = GetPlayerVehicleID(playerid);
  56.             SetVehiclePos(tmpcar, GetPVarFloat(playerid,"xpos"),GetPVarFloat(playerid,"ypos"),GetPVarFloat(playerid,"zpos"));
  57.             LinkVehicleToInterior(tmpcar, GetPVarInt(playerid,"int"));
  58.         }
  59.         else
  60.         {
  61.             SetPlayerPos(playerid, GetPVarFloat(playerid,"xpos"), GetPVarFloat(playerid,"ypos"), GetPVarFloat(playerid,"zpos"));
  62.             SetPlayerInterior(playerid, GetPVarInt(playerid,"int"));
  63.         }
  64.         SendClientMessage(playerid, 0x33AA33AA, "Loaded Saved Position.");
  65.         }
  66.     return 1;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment