Advertisement
Guest User

get

a guest
Mar 9th, 2013
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 KB | None | 0 0
  1. //---------------------getip------------------
  2. if(strcmp(cmd, "/getip", true) == 0)
  3. {
  4. if (PlayerInfo[playerid][pAdmin] >= 2)
  5. {
  6. tmp = strtok(cmdtext,idx);
  7. new playersip[256];
  8. if(!strlen(tmp))
  9. {
  10. SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /getip [Players ID]");
  11. return 1;
  12. }
  13. giveplayerid = ReturnUser(tmp);
  14. GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  15. GetPlayerIp( giveplayerid,playersip,sizeof(playersip));
  16. format(string, sizeof(string), "Player: %s IP: %s",giveplayer,playersip);
  17. SendClientMessage(playerid,COLOR_GRAD2,string);
  18. }
  19. return 1;
  20. }
  21.  
  22. //----------------------------------[GETHERE]-----------------------------------------------
  23. if(strcmp(cmd, "/gethere", true) == 0)
  24. {
  25. if(IsPlayerConnected(playerid))
  26. {
  27. tmp = strtok(cmdtext, idx);
  28. if(!strlen(tmp))
  29. {
  30. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /gethere [playerid/PartOfName]");
  31. return 1;
  32. }
  33. new Float:plocx,Float:plocy,Float:plocz;
  34. new plo;
  35. plo = ReturnUser(tmp);
  36. if (IsPlayerConnected(plo))
  37. {
  38. if(plo != INVALID_PLAYER_ID)
  39. {
  40. if (PlayerInfo[plo][pAdmin] > 7)
  41. {
  42. SendClientMessage(playerid, COLOR_GRAD1, "Ask the admin to goto you.");
  43. return 1;
  44. }
  45. if (PlayerInfo[playerid][pAdmin] >= 3 || PlayerInfo[playerid][pHelper] >= 3)
  46. {
  47. GetPlayerPos(playerid, plocx, plocy, plocz);
  48. if(PlayerInfo[playerid][pInt] > 0)
  49. {
  50. SetPlayerInterior(plo,PlayerInfo[playerid][pInt]);
  51. PlayerInfo[plo][pInt] = PlayerInfo[playerid][pInt];
  52. PlayerInfo[plo][pLocal] = PlayerInfo[playerid][pLocal];
  53. }
  54. if(PlayerInfo[playerid][pInt] == 0)
  55. {
  56. SetPlayerInterior(plo,0);
  57. }
  58. if(plocz > 930.0 && PlayerInfo[playerid][pInt] == 0) //the highest land point in sa = 526.8
  59. {
  60. SetPlayerInterior(plo,1);
  61. PlayerInfo[plo][pInt] = 1;
  62. }
  63. if (GetPlayerState(plo) == 2)
  64. {
  65. TelePos[plo][0] = 0.0;
  66. TelePos[plo][1] = 0.0;
  67. new tmpcar = GetPlayerVehicleID(plo);
  68. SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
  69. }
  70. else
  71. {
  72. SetPlayerPos(plo,plocx,plocy+2, plocz);
  73. }
  74. SendClientMessage(plo, COLOR_GRAD1, " You have been teleported");
  75. }
  76. else
  77. {
  78. SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
  79. }
  80. }
  81. }
  82. else
  83. {
  84. format(string, sizeof(string), " %d is not an active player.", plo);
  85. SendClientMessage(playerid, COLOR_GRAD1, string);
  86. }
  87. }
  88. return 1;
  89. }
  90. if(strcmp(cmd, "/getallhere", true) == 0)
  91. {
  92. if(IsPlayerConnected(playerid))
  93. {
  94. if(PlayerInfo[playerid][pAdmin] >= 5)
  95. {
  96. GetPlayerName(playerid, sendername, sizeof(sendername));
  97. for(new i = 0; i < MAX_PLAYERS; i ++)
  98. {
  99. if(IsPlayerConnected(i))
  100. {
  101. format(string, 256, "Administrator %s has teleported everyone to himself.", sendername);
  102. BroadCast(COLOR_LIGHTRED,string);
  103. new Float:ix, Float:iy, Float:iz;
  104. GetPlayerPos(playerid, ix, iy, iz);
  105. SetPlayerInterior(i, GetPlayerInterior(playerid));
  106. SetPlayerPos(i, ix, iy, iz+1);
  107. GetPlayerName(playerid, sendername, sizeof(sendername));
  108. printf("[Warning] %s has teleported all players to him", sendername);
  109. ABroadCast(COLOR_LIGHTRED,string,1);
  110. }
  111. }
  112. }
  113. else
  114. {
  115. SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
  116. }
  117. }
  118. else
  119. {
  120. SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
  121. }
  122. return 1;
  123. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement