Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- #define FILTERSCRIPT
- #include <a_samp>
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Save/Load Position System By Tox'");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- #endif
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext, "/s", true) ==0)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- SetPVarFloat(playerid,"xpos",x); // save X POS
- SetPVarFloat(playerid,"ypos",y); // save Y POS
- SetPVarFloat(playerid,"zpos",z); // save Z POS
- SetPVarInt(playerid,"int",GetPlayerInterior(playerid));//get interior
- SendClientMessage(playerid,0x33AA33AA,"Position Saved! Use /r To Get back To It!,");
- }
- return 1;
- }
- if (strcmp("/r", cmdtext, true, 10) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if (GetPlayerState(playerid) == 2)
- {
- new tmpcar = GetPlayerVehicleID(playerid);
- SetVehiclePos(tmpcar, GetPVarFloat(playerid,"xpos"),GetPVarFloat(playerid,"ypos"),GetPVarFloat(playerid,"zpos"));
- LinkVehicleToInterior(tmpcar, GetPVarInt(playerid,"int"));
- }
- else
- {
- SetPlayerPos(playerid, GetPVarFloat(playerid,"xpos"), GetPVarFloat(playerid,"ypos"), GetPVarFloat(playerid,"zpos"));
- SetPlayerInterior(playerid, GetPVarInt(playerid,"int"));
- }
- SendClientMessage(playerid, 0x33AA33AA, "Loaded Saved Position.");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment