Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new Posaved[MAX_PLAYERS];
- public OnPlayerConnect(playerid)
- {
- Posaved[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid)
- {
- Posaved[playerid] = 0;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp("/sp", cmdtext, true))
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- SetPVarFloat(playerid,"X",x);
- SetPVarFloat(playerid,"Y",y);
- SetPVarFloat(playerid,"Z",z);
- SendClientMessage(playerid, 0x10F441AA, "You have set your position. Type /lp to teleport to it!");
- if(Posaved[playerid] == 0)
- {
- Posaved[playerid] = 1;
- }
- return 1;
- }
- if(!strcmp("/lp", cmdtext, true))
- {
- if(Posaved[playerid] == 1)
- {
- SetPlayerPos(playerid, GetPVarFloat(playerid,"X"), GetPVarFloat(playerid,"Y"), GetPVarFloat(playerid,"Z"));
- SendClientMessage(playerid, 0x10F441AA, "Welcome to your Last Position!");
- }
- else SendClientMessage(playerid, 0xAA3333AA, "You did not save your position with /sp!");
- return 1;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment