GetPlayerIp
#1

Код:
CMD:getip(playerid, params[]) {

    new giveid,string[128], ipstring[25];
   	if (PlayerInfo[playerid][Admin] < 2) return SendClientMessage( playerid, -1, ""RED"ERROR: "GREY"You are not authorized to use this command!");
	if (sscanf(params, "us[28]", giveid)) return SendClientMessage(playerid, USAGE, "{F07F1D}USAGE: {BBFF00}/getip <ID>" );
	if (giveid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"Invalid player ID!");
    GetPlayerIp(giveid,ipstring,255)
    format(string, sizeof(string), "IP: %s",ipstring);
    SendClientMessage(playerid,COLOR_RED, string);
    return 1;
    }
Код:
C:\Users\TRAFEH\Desktop\usfMain.pwn(4381) : error 001: expected token: ";", but found "-identifier-"
what wrong?
Reply
#2

GetPlayerIp(giveid,ipstring,255) ;
Reply
#3

PHP код:
CMD:getip(playeridparams[]) 
{
    new 
giveid,string[128], ipstring[25];
    if (
PlayerInfo[playerid][Admin] < 2) return SendClientMessageplayerid, -1""RED"ERROR: "GREY"You are not authorized to use this command!");
    if (
sscanf(params"u"giveid)) return SendClientMessage(playeridUSAGE"{F07F1D}USAGE: {BBFF00}/getip <ID>" );
    if (
giveid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1""RED"ERROR: "GREY"Invalid player ID!");
    
GetPlayerIp(giveid,ipstring,sizeof(ipstring)); //The problem was this ; was missing, but I made it kinda better. Feel free to use yours.
    
format(stringsizeof(string), "IP: %s",ipstring);
    
SendClientMessage(playerid,COLOR_REDstring);
    return 
1;

Edit: Azula was faster than me lol
Reply
#4

Thank you very much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)