Advertisement
Peppery

getip

Feb 13th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. public OnPlayerCommandText(playerid, cmdtext[])
  2.  
  3. {
  4. dcmd(getip, 5, cmdtext);
  5. return 0;
  6. }
  7.  
  8. dcmd_getip(playerid, params[])
  9. {
  10. new targetid = strval(params);
  11. new pName[MAX_PLAYER_NAME];
  12. GetPlayerName(targetid, pName, sizeof(pName));
  13. new plrIP[16];
  14. GetPlayerIP(targetid, plrIP, sizeof(plrIP));
  15. if(!IsPlayerAdmin(playerid)) return 0;
  16. new string[128];
  17. if(sscanf(params, "uz", targetid, reason)) return SendClientMessage(playerid, COLOR_RED, "Usage: /getip [playerid/partofname]"); // Checking if the player just typed /ban
  18. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "Player not connected or is yourself!"); // Here just checking if the player is not connected or is you.
  19. format(string, sizeof(string), "Here is %s 's IP: %s",pName, plrIP);
  20. SendClientMessage(playerid, string)
  21. return 1;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement