SA-MP Forums Archive
[Ajuda] Ajuda com esse comando - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Ajuda com esse comando (/showthread.php?tid=655810)



Ajuda com esse comando - elTioFrame - 30.06.2018

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;
}



Re: Ajuda com esse comando - AdrianoStk - 30.06.2018

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!!!


Re: Ajuda com esse comando - elTioFrame - 30.06.2018

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

;-;


Re: Ajuda com esse comando - powerths - 30.06.2018

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 ;


Re: Ajuda com esse comando - elTioFrame - 30.06.2018

Код:
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 :/


Re: Ajuda com esse comando - Cauezin - 30.06.2018

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]; 



Re: Ajuda com esse comando - AllanSG - 30.06.2018

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;
}



Re: Ajuda com esse comando - elTioFrame - 30.06.2018

Код:
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


Re: Ajuda com esse comando - FerrariL - 30.06.2018

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



Re: Ajuda com esse comando - AdrianoStk - 30.06.2018

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!!!