SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 04/02/2017, 02:40 PM   #1
LuanGamer
Big Clucker
 
Join Date: Oct 2016
Posts: 76
Reputation: 0
Question Ip dos players

Boa tarde, estou tentando fazer com que somente apareça o ip para os admins superiores ao os players se conectarem, porém o ip não aparece para ninguem, creio q seja algum erro no código.

Código original:
Code:
new IPDoCara[32];
	GetPlayerIp(playerid, IPDoCara, sizeof IPDoCara);
	format(string2, sizeof(string2), "AdmCmd: %s (IP: %s) conectou-se.", PlayerName(playerid),IPDoCara);
Novo código tentado:
PHP Code:
new IPDoCara[32];
    
GetPlayerIp(playeridIPDoCarasizeof IPDoCara);
    if (
PlayerInfo[playerid][pAdmin] >= 3000)
    {
    
format(string2sizeof(string2), "AdmCmd: %s (IP: %s) conectou-se."PlayerName(playerid),IPDoCara);
    }
    if(
PlayerInfo[playerid][pAdmin] < 3000)
    {
    
format(string2sizeof(string2), "AdmCmd: %s conectou-se."PlayerName(playerid));
    } 
LuanGamer is offline   Reply With Quote
Old 04/02/2017, 03:00 PM   #2
Felipe1241421
Big Clucker
 
Join Date: Jul 2016
Posts: 115
Reputation: 1
Default Re: Ip dos players

Quote:
Originally Posted by LuanGamer View Post
Boa tarde, estou tentando fazer com que somente apareça o ip para os admins superiores ao os players se conectarem, porém o ip não aparece para ninguem, creio q seja algum erro no código.

Código original:
Code:
new IPDoCara[32];
	GetPlayerIp(playerid, IPDoCara, sizeof IPDoCara);
	format(string2, sizeof(string2), "AdmCmd: %s (IP: %s) conectou-se.", PlayerName(playerid),IPDoCara);
Novo código tentado:
PHP Code:
new IPDoCara[32];
    
GetPlayerIp(playeridIPDoCarasizeof IPDoCara);
    if (
PlayerInfo[playerid][pAdmin] >= 3000)
    {
    
format(string2sizeof(string2), "AdmCmd: %s (IP: %s) conectou-se."PlayerName(playerid),IPDoCara);
    }
    if(
PlayerInfo[playerid][pAdmin] < 3000)
    {
    
format(string2sizeof(string2), "AdmCmd: %s conectou-se."PlayerName(playerid));
    } 
Code:
Tenta colocar um else ou else if nessa parte:

new IPDoCara[32];
	GetPlayerIp(playerid, IPDoCara, sizeof IPDoCara);
    if (PlayerInfo[playerid][pAdmin] >= 3000)
    {
	format(string2, sizeof(string2), "AdmCmd: %s (IP: %s) conectou-se.", PlayerName(playerid),IPDoCara);
	}
	else if(PlayerInfo[playerid][pAdmin] < 3000)
	{
    format(string2, sizeof(string2), "AdmCmd: %s conectou-se.", PlayerName(playerid));
	}
__________________
Sei lá, bro...
Felipe1241421 is offline   Reply With Quote
Old 04/02/2017, 03:38 PM   #3
RazorGuigo
Banned
 
Join Date: May 2016
Location: South is my Country
Posts: 1,132
Reputation: 104
Cool Programando e Gambiarrando!

PHP Code:
public OnPlayerConnect(playerid)
{
    new 
IPDoCara[16],string1[100],string2[100];  
    
GetPlayerIp(playeridIPDoCara16);  

    
format(string1sizeof(string1), "AdmCmd: %s conectou-se."PlayerName(playerid));  
    
format(string2sizeof(string2), "AdmCmd: %s (IP: %s) conectou-se."PlayerName(playerid),IPDoCara);  

    for(new 
plid 0plid GetPlayerPoolSize()+1plid++)
    {
        if(
PlayerInfo[plid][pAdmin] >= 3000)    SendClientMessage(plid0xFF0000FFstring2);        
        else                                    
SendClientMessage(plid0xFF0000FFstring1); 
    }
    return 
1;

RazorGuigo is offline   Reply With Quote
Old 04/02/2017, 04:23 PM   #4
SammyJ
Gangsta
 
SammyJ's Avatar
 
Join Date: May 2015
Location: Rio de Janeiro
Posts: 811
Reputation: 71
Default Respuesta: Ip dos players

PHP Code:
    new ip[32]; 
    
GetPlayerIp(playeridipsizeof ip);
    for(new 
iMAX_PLAYERSi++)
    {
        if(!
IsPlayerConnected(i))
            continue;

        if (
PlayerInfo[i][pAdmin] >= 3000
            
format(string2sizeof(string2), "AdmCmd: %s (IP: %s) conectou-se."PlayerName(playerid), ip);
        else
            
format(string2sizeof(string2), "AdmCmd: %s conectou-se."PlayerName(playerid)); 

        
SendClientMessage(i, -1string2);
    } 
__________________
SammyJ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
a idea for disarm all players and give all players ? Saliim Scripting Help 10 30/04/2016 07:19 PM
Send players into arena after 2+ players are ready. rangerxxll Scripting Help 2 05/03/2014 03:32 AM
Let admins read players' PM's selectively without players number limitation WellDone Scripting Help 6 15/05/2013 09:34 AM
[HELP]Show Players Rank Above Players Head/Name Eminem 2ka9 Scripting Help 13 07/08/2012 03:24 AM
Revolutionary Roleplay [Heavy RP - By the Players, For the Players] Thoughts? Jarred Miller General 5 12/06/2011 07:06 PM


All times are GMT. The time now is 11:08 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.