Guest User

Save Last Pos 2

a guest
Sep 26th, 2010
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.38 KB | None | 0 0
  1. //Fs by [ISS]jumbo
  2. // :D :D :D :D :D :D :D :D :D  Save Last Pos
  3. //#define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6. enum Posizione {
  7. Float:XPos,
  8. Float:YPos,
  9. Float:ZPos,
  10. };
  11. new Giocatore[MAX_PLAYERS][Posizione];
  12. new Fdie[MAX_PLAYERS];
  13. public OnFilterScriptInit()
  14. {
  15.     print("\n--------------------------------------");
  16.     print(" Save Last Pos loaded");
  17.     print("--------------------------------------\n");
  18.     return 1;
  19. }
  20.  
  21. public OnPlayerSpawn(playerid)
  22. {
  23.     if(Fdie[playerid] == 1)
  24.     {
  25.     ShowPlayerDialog(playerid,4283,DIALOG_STYLE_MSGBOX,"....RESPAWN....","Would you like to respawn where you died?","Yes","No");
  26.     }
  27.     else if(Fdie[playerid] == 0)
  28.     {
  29.     }
  30.     return 1;
  31. }
  32.  
  33. public OnPlayerDeath(playerid, killerid, reason)
  34. {
  35.     GetPlayerPos(playerid,Giocatore[playerid][XPos],Giocatore[playerid][YPos],Giocatore[playerid][ZPos]);
  36.     Fdie[playerid]=1;
  37.     return 1;
  38. }
  39.  
  40. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  41. {
  42.     if(dialogid == 4283)
  43.     {
  44.         if(response == 1)
  45.         {
  46.         SendClientMessage(playerid, 0xF60000AA, "ok respawn where you died");
  47.         SetPlayerPos(playerid,Giocatore[playerid][XPos],Giocatore[playerid][YPos],Giocatore[playerid][ZPos]);
  48.         }
  49.     }
  50.     if(dialogid == 4283)
  51.     {
  52.         if(response == 0)
  53.         {
  54.         SendClientMessage(playerid, 0xF60000AA, "ok you will not respawn where you died");
  55.         }
  56.     }
  57.     return 1;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment