[Ajuda] Ajuda com esse comando
#1

Tava criando um comando de ver o ip e ping do id informado mas como sempre , deu erro :/ alguem pode me dizer o erro ai ? jб nгo sei oq eu faзo!


Command
Код:
CMD:ip(playerid, params[])
{
 	if(!IsPlayerAdmin(playerid))
 		return SendClientMessage(playerid, -1, "[!] Vocк nгo й ADM [!]");
 		
	new id;
	new ip;
	new ping;
	new formato[128];
	if(sscanf(params, "ddd", id,ip,ping)) return SendClientMessage(playerid, CINZA, "Use: /ip [ID do Player]");
	if(!IsPlayerConnected(id)) return SendClientMessage(playerid, VERMELHO, "[!] ID Offline [!]");
	GetPlayerIp(ip);
	GetPlayerNetworkStats(ping);
	format(formato, sizeof(formato), "Informaзoes do player IP:%d PING:%d " ip,ping);
	SendClientMessage(playerid, VERDE, formato)
	return 1;
}
Reply
#2

PHP код:
CMD:ip(playeridparams[]) 

    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"[!] Vocк nгo й ADM [!]"); 
    new 
idip[16], pingStr[128]; 
    if(
sscanf(params"u"id)) return SendClientMessage(playerid, -1"Use: /ip [ID do Player]"); 
    if(!
IsPlayerConnected(id)) return SendClientMessage(playerid, -1"[!] ID Offline [!]"); 
    
GetPlayerIp(idipsizeof(ip)); 
    
ping GetPlayerPing(id); 
    
format(Strsizeof(Str), "Informaзoes do player IP:%s PING:%d "ipping); 
    
SendClientMessage(playerid, -1Str); 
    return 
1

Seja feliz!!!
Reply
#3

C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(267) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(267) : warning 215: expression has no effect
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(267) : warning 215: expression has no effect
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(267) : error 001: expected token: ";", but found ")"
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(267) : error 029: invalid expression, assumed zero
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(267) : fatal error 107: too many error messages on one line

;-;
Reply
#4

PHP код:

    format
(Strsizeof(Str), "Informaзoes do player IP:%d PING:%d " ip,ping); 
    
SendClientMessage(playeridVERDEStr) <----- AQUI!!
    
format(Strsizeof(Str), "Informaзoes do player IP:%d PING:%d " ip,ping); 
    
SendClientMessage(playeridVERDEStr); 
faltou ;
Reply
#5

Код:
CMD:ip(playerid, params[])
{
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "[!] Vocк nгo й ADM [!]");
    new id;, ip[16];, ping;, Str[128];
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, CINZA, "Use: /ip [ID do Player]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, VERMELHO, "[!] ID Offline [!]");
    GetPlayerIp(id, ip, sizeof(ip));
    ping = GetPlayerPing(id);
    format(Str, sizeof(Str), "Informaзoes do player IP:%d PING:%d " ip,ping);
    SendClientMessage(playerid, VERDE, Str);
    return 1;
}
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(264) : error 029: invalid expression, assumed zero
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(264) : error 017: undefined symbol "ip"
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(264) : warning 215: expression has no effect
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(264) : error 001: expected token: ";", but found "]"
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(264) : fatal error 107: too many error messages on one line

poxa :/
Reply
#6

Quote:
Originally Posted by elTioFrame
Посмотреть сообщение
Код:
CMD:ip(playerid, params[])
{
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "[!] Vocк nгo й ADM [!]");
    new id;, ip[16];, ping;, Str[128];
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, CINZA, "Use: /ip [ID do Player]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, VERMELHO, "[!] ID Offline [!]");
    GetPlayerIp(id, ip, sizeof(ip));
    ping = GetPlayerPing(id);
    format(Str, sizeof(Str), "Informaзoes do player IP:%d PING:%d " ip,ping);
    SendClientMessage(playerid, VERDE, Str);
    return 1;
}
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(264) : error 029: invalid expression, assumed zero
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(264) : error 017: undefined symbol "ip"
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(264) : warning 215: expression has no effect
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(264) : error 001: expected token: ";", but found "]"
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(264) : fatal error 107: too many error messages on one line

poxa :/
PHP код:
new id;, ip[16];, ping;, Str[128];   ????????? 
PHP код:
new idip[16], pingStr[128]; 
Reply
#7

pawn Код:
CMD:ip(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "[!] Vocк nгo й ADM [!]");
    new id, ip[16], ping, Str[128];
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, CINZA, "Use: /ip [ID do Player]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, VERMELHO, "[!] ID Offline [!]");
    GetPlayerIp(id, ip, sizeof(ip));
    ping = GetPlayerPing(id);
    format(Str, sizeof(Str), "Informaзoes do player IP:%d PING:%d " ip,ping);
    SendClientMessage(playerid, VERDE, Str);
    return 1;
}
Reply
#8

Код:
CMD:ip(playerid, params[])
{
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "[!] Vocк nгo й ADM [!]");
    new id, ip[16], ping, Str[128];
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, CINZA, "Use: /ip [ID do Player]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, VERMELHO, "[!] ID Offline [!]");
    GetPlayerIp(id, ip, sizeof(ip));
    ping = GetPlayerPing(id);
    format(Str, sizeof(Str), "Informaзoes do player IP:%d PING:%d " ip,ping);
    SendClientMessage(playerid, VERDE, Str);
    return 1;
}
Ainda da error:
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(269) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(269) : warning 215: expression has no effect
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(269) : warning 215: expression has no effect
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(269) : error 001: expected token: ";", but found ")"
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(269) : error 029: invalid expression, assumed zero
C:\Users\usъario\Documents\Daniel\Server Files\LifeRolePlay\gamemodes\LRP.pwn(269) : fatal error 107: too many error messages on one line
Reply
#9

pawn Код:
format(Str, sizeof(Str), "Informaзoes do player IP: %s PING: %d " ip,ping);
Reply
#10

PHP код:
CMD:ip(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"[!] Vocк nгo й ADM [!]");
    new 
idip[16], pingStr[128];
    if(
sscanf(params"u"id)) return SendClientMessage(playerid, -1"Use: /ip [ID do Player]");
    if(!
IsPlayerConnected(id)) return SendClientMessage(playerid, -1"[!] ID Offline [!]");
    
GetPlayerIp(idipsizeof(ip));
    
ping GetPlayerPing(id);
    
format(Strsizeof(Str), "Informaзoes do player IP:%s PING:%d "ipping);
    
SendClientMessage(playerid, -1Str);
    return 
1;

ou pode utilizar assim...
PHP код:
CMD:ip(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"[!] Vocк nгo й ADM [!]");
    new 
idip[16], Str[128];
    if(
sscanf(params"u"id)) return SendClientMessage(playerid, -1"Use: /ip [ID do Player]");
    if(!
IsPlayerConnected(id)) return SendClientMessage(playerid, -1"[!] ID Offline [!]");
    
GetPlayerIp(idipsizeof(ip));
    
format(Strsizeof(Str), "Informaзoes do player IP:%s PING:%d "ipGetPlayerPing(id));
    
SendClientMessage(playerid, -1Str);
    return 
1;


Pronto!!!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)