Advertisement
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>
- #include <a_samp>
- #include <zcmd>
- #include <sscanf>
- enum Locations{
- Float:l1x,
- Float:l1y,
- Float:l1z,
- Float:l2x,
- Float:l2y,
- Float:l2z,
- Float:l3x,
- Float:l3y,
- Float:l3z,
- Float:l4x,
- Float:l4y,
- Float:l4z,
- Float:l5x,
- Float:l5y,
- Float:l5z
- };
- new PlayerLocation[MAX_PLAYERS][Locations];
- #define FILTERSCRIPT
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" TP Filterscript by Akib Khan");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- #endif
- COMMAND:gotolocation(playerid,params[])
- {
- new locationid;
- if(sscanf(params,"i",locationid))
- {
- SendClientMessage(playerid, -1, "Usage : /gotolocation [Slot it]");
- SendClientMessage(playerid, -1, "Slots:");
- new m[126];
- format(m, sizeof(m), "Slot 1 : %f,%f,%f", PlayerLocation[playerid][l1x],PlayerLocation[playerid][l1y],PlayerLocation[playerid][l1z]);
- SendClientMessage(playerid, -1, m);
- format(m, sizeof(m), "Slot 2 : %f,%f,%f", PlayerLocation[playerid][l2x],PlayerLocation[playerid][l2y],PlayerLocation[playerid][l2z]);
- SendClientMessage(playerid, -1, m);
- format(m, sizeof(m), "Slot 3 : %f,%f,%f", PlayerLocation[playerid][l3x],PlayerLocation[playerid][l3y],PlayerLocation[playerid][l3z]);
- SendClientMessage(playerid, -1, m);
- format(m, sizeof(m), "Slot 4 : %f,%f,%f", PlayerLocation[playerid][l4x],PlayerLocation[playerid][l4y],PlayerLocation[playerid][l4z]);
- SendClientMessage(playerid, -1, m);
- format(m, sizeof(m), "Slot 5 : %f,%f,%f", PlayerLocation[playerid][l5x],PlayerLocation[playerid][l5y],PlayerLocation[playerid][l5z]);
- SendClientMessage(playerid, -1, m);
- }
- if(locationid==1)
- {
- if(PlayerLocation[playerid][l1x]==0.000 && PlayerLocation[playerid][l1y]==0.000 && PlayerLocation[playerid][l1z]==0.000)
- {
- SendClientMessage(playerid, -1, "No location are saved on this slot.");
- }
- SetPlayerPos(playerid,PlayerLocation[playerid][l1x],PlayerLocation[playerid][l1y],PlayerLocation[playerid][l1z]);
- }
- if(locationid==2)
- {
- if(PlayerLocation[playerid][l2x]==0.000 && PlayerLocation[playerid][l2y]==0.000 && PlayerLocation[playerid][l2z]==0.000)
- {
- SendClientMessage(playerid, -1, "No location are saved on this slot.");
- }
- SetPlayerPos(playerid,PlayerLocation[playerid][l2x],PlayerLocation[playerid][l2y],PlayerLocation[playerid][l2z]);
- }
- if(locationid==3)
- {
- if(PlayerLocation[playerid][l3x]==0.000 && PlayerLocation[playerid][l3y]==0.000 && PlayerLocation[playerid][l3z]==0.000)
- {
- SendClientMessage(playerid, -1, "No location are saved on this slot.");
- }
- SetPlayerPos(playerid,PlayerLocation[playerid][l3x],PlayerLocation[playerid][l3y],PlayerLocation[playerid][l3z]);
- }
- if(locationid==4)
- {
- if(PlayerLocation[playerid][l4x]==0.000 && PlayerLocation[playerid][l4y]==0.000 && PlayerLocation[playerid][l4z]==0.000)
- {
- SendClientMessage(playerid, -1, "No location are saved on this slot.");
- }
- SetPlayerPos(playerid,PlayerLocation[playerid][l4x],PlayerLocation[playerid][l4y],PlayerLocation[playerid][l4z]);
- }
- if(locationid==5)
- {
- if(PlayerLocation[playerid][l5x]==0.000 && PlayerLocation[playerid][l5y]==0.000 && PlayerLocation[playerid][l5z]==0.000)
- {
- SendClientMessage(playerid, -1, "No location are saved on this slot.");
- }
- SetPlayerPos(playerid,PlayerLocation[playerid][l5x],PlayerLocation[playerid][l5y],PlayerLocation[playerid][l5z]);
- }
- return 1;
- }
- COMMAND:savelocation(playerid,params[])
- {
- new locationid;
- if(sscanf(params,"i",locationid))
- {
- SendClientMessage(playerid, -1, "Usage : /savelocation [Slot it]");
- SendClientMessage(playerid, -1, "Slots:");
- new m[126];
- format(m, sizeof(m), "Slot 1 : %f,%f,%f", PlayerLocation[playerid][l1x],PlayerLocation[playerid][l1y],PlayerLocation[playerid][l1z]);
- SendClientMessage(playerid, -1, m);
- format(m, sizeof(m), "Slot 2 : %f,%f,%f", PlayerLocation[playerid][l2x],PlayerLocation[playerid][l2y],PlayerLocation[playerid][l2z]);
- SendClientMessage(playerid, -1, m);
- format(m, sizeof(m), "Slot 3 : %f,%f,%f", PlayerLocation[playerid][l3x],PlayerLocation[playerid][l3y],PlayerLocation[playerid][l3z]);
- SendClientMessage(playerid, -1, m);
- format(m, sizeof(m), "Slot 4 : %f,%f,%f", PlayerLocation[playerid][l4x],PlayerLocation[playerid][l4y],PlayerLocation[playerid][l4z]);
- SendClientMessage(playerid, -1, m);
- format(m, sizeof(m), "Slot 5 : %f,%f,%f", PlayerLocation[playerid][l5x],PlayerLocation[playerid][l5y],PlayerLocation[playerid][l5z]);
- SendClientMessage(playerid, -1, m);
- }
- new Float:t_x,Float:t_y,Float:t_z;
- GetPlayerPos(playerid, Float:t_x, Float:t_y, Float:t_z);
- if(locationid==1)
- {
- PlayerLocation[playerid][l1x] = Float:t_x;
- PlayerLocation[playerid][l1y] = Float:t_y;
- PlayerLocation[playerid][l1z] = Float:t_z;
- SendClientMessage(playerid, -1, "Location Saved!");
- }
- if(locationid==2)
- {
- PlayerLocation[playerid][l2x] = Float:t_x;
- PlayerLocation[playerid][l2y] = Float:t_y;
- PlayerLocation[playerid][l2z] = Float:t_z;
- SendClientMessage(playerid, -1, "Location Saved!");
- }
- if(locationid==3)
- {
- PlayerLocation[playerid][l3x] = Float:t_x;
- PlayerLocation[playerid][l3y] = Float:t_y;
- PlayerLocation[playerid][l3z] = Float:t_z;
- SendClientMessage(playerid, -1, "Location Saved!");
- }
- if(locationid==4)
- {
- PlayerLocation[playerid][l4x] = Float:t_x;
- PlayerLocation[playerid][l4y] = Float:t_y;
- PlayerLocation[playerid][l4z] = Float:t_z;
- SendClientMessage(playerid, -1, "Location Saved!");
- }
- if(locationid==5)
- {
- PlayerLocation[playerid][l5x] = Float:t_x;
- PlayerLocation[playerid][l5y] = Float:t_y;
- PlayerLocation[playerid][l5z] = Float:t_z;
- SendClientMessage(playerid, -1, "Location Saved!");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement