Advertisement
Guest User

IG Spawn Location Changer By Lh[MDZ]

a guest
Jun 9th, 2012
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.31 KB | None | 0 0
  1. // Dynamic I-G Spawn Location Changing System By Littlehelper[MDZ].
  2. // Please Donot Remove The Credits And/Or Redistribute This As Your Own!
  3. #define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6. #include <zcmd>
  7.  
  8. new
  9.     Float:CurrentSpawn[3];
  10. new
  11.     Float:CurrentFA[1];
  12.    
  13. #define DIALOG_SPAWN 999
  14.  
  15. public OnFilterScriptInit()
  16. {
  17.     print("\n-----------------------------------------------------");
  18.     print("IG Spawn Location Changing By Littlehelper[MDZ] Loaded");
  19.     print("--------------------------------------------------------\n");
  20.     return 1;
  21. }
  22.  
  23. public OnFilterScriptExit()
  24. {
  25.     return 1;
  26. }
  27.  
  28. public OnPlayerConnect(playerid)
  29. {
  30.     SendClientMessageToAll(-1,"Server Using 'IG Spawn Location Changing' By Littlehelper[MDZ]");
  31.     return 1;
  32. }
  33.  
  34. public OnPlayerDisconnect(playerid, reason)
  35. {
  36.     return 1;
  37. }
  38. public OnPlayerSpawn(playerid)
  39. {
  40.     SendClientMessage(playerid,-1,"Type /NewSpawn To Change Your Spawn Location");
  41.     SetPlayerPos(playerid,CurrentSpawn[0],CurrentSpawn[1],CurrentSpawn[2]);
  42.     SetPlayerFacingAngle(playerid,CurrentFA[0]);
  43.     return 1;
  44. }
  45. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  46. {
  47.     new Float:X,Float:Y,Float:Z,Float:FA,String[128],pName[128];
  48.     if(dialogid == DIALOG_SPAWN)
  49.     {
  50.         if(!response) return TogglePlayerControllable(playerid,true);
  51.         GetPlayerPos(playerid,X,Y,Z);
  52.         GetPlayerFacingAngle(playerid,FA);
  53.         CurrentSpawn[0] = Float:X;
  54.         CurrentSpawn[1] = Float:Y;
  55.         CurrentSpawn[2] = Float:Z;
  56.         CurrentFA[0] = Float:FA;
  57.         TogglePlayerControllable(playerid,true);
  58.         GetPlayerName(playerid,pName,sizeof(pName));
  59.         format(String,sizeof(String),"Spawn Location Has Been Changed By Administrator %s",pName);
  60.         SendClientMessageToAll(-1,String);
  61.         SendClientMessage(playerid,-1,"Spawning Area Has Been Changed Successfully!");
  62.     }
  63.     return 0;
  64. }
  65.  
  66. CMD:kill(playerid,params[])
  67. {
  68. SpawnPlayer(playerid);
  69. return 1;
  70. }
  71.  
  72. CMD:newspawn(playerid,params[])
  73. {
  74. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You Are Not Authorized To Use This Command!"); // You Can Remove This If You Dont Want Only Administrators To Use This Command.
  75. TogglePlayerControllable(playerid,false);
  76. ShowPlayerDialog(playerid,DIALOG_SPAWN,DIALOG_STYLE_MSGBOX,"{FFAF00}:: {FFFFFF}Dynamic Spawn Changing","{FFFFFF}Are You Sure You Want To Change The Spawn Area To This Place?","Yes","No");
  77. return 1;
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement