Message Not Work
#1

PHP код:
public OnPlayerConnect(playerid)
{
    new 
connected[128],plname[MAX_PLAYER_NAME],plip[MAX_PLAYER_NAME],Country[MAX_PLAYER_NAME],City[MAX_PLAYER_NAME];
    
GetPlayerCountry(playeridCountrysizeof(Country));
    
GetPlayerCity(playerid,Citysizeof(City));
    
GetPlayerName(playeridplnamesizeof(plname));
    
GetPlayerIp(playeridplipsizeof(plip));
    
format(connected,sizeof(connected),"{00ff00}[Join]:{0000ff}%s {ff0000}Has Joined The Server{00ffff}[{ffffff}IP:{ffff00}%s{00ffff}]{00ffff}[{ffffff}Contry:{ffff00}%s{00ffff}]{00ffff}[{fffff00}City: %s{00ffff}]",plname,plip,Country,City);
    
SendClientMessageToAll(playerid,connected);
    return 
1;

Not The Message Show Complet
PHP код:
public OnPlayerConnect(playerid)
{
    new 
connected[999],plname[MAX_PLAYER_NAME],plip[MAX_PLAYER_NAME],Country[MAX_PLAYER_NAME],City[MAX_PLAYER_NAME];
    
GetPlayerCountry(playeridCountrysizeof(Country));
    
GetPlayerCity(playerid,Citysizeof(City));
    
GetPlayerName(playeridplnamesizeof(plname));
    
GetPlayerIp(playeridplipsizeof(plip));
    
format(connected,sizeof(connected),"{00ff00}[Join]:{0000ff}%s {ff0000}Has Joined The Server{00ffff}[{ffffff}IP:{ffff00}%s{00ffff}]{00ffff}[{ffffff}Contry:{ffff00}%s{00ffff}]{00ffff}[{fffff00}City: %s{00ffff}]",plname,plip,Country,City);
    
SendClientMessageToAll(playerid,connected);
    return 
1;

The Message Not Show
Reply
#2

PHP код:
SendClientMessageToAll(playerid,connected); 
to

PHP код:
SendClientMessageToAll(-1,connected); 
SendClientMessageToAll(color, const message[]) and why playerid if message send to all?

also SendClientMessage show only 128 characters so you wont see all message!

and connected[999] ?? isnt it too much?
Reply
#3

hhhhhhhh that is not the prob because
PHP код:
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase 
the prob in new connect[999];
Reply
#4

hhhhhhhh that is not the prob because
PHP код:
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase 
the prob in new connect[999];
Reply
#5

PHP код:
public OnPlayerConnect(playerid

    new 
connected[256],plname[MAX_PLAYER_NAME],plip[126],Country[126],City[126]; 
    
GetPlayerCountry(playeridCountrysizeof(Country)); 
    
GetPlayerCity(playerid,Citysizeof(City)); 
    
GetPlayerName(playeridplnamesizeof(plname)); 
    
GetPlayerIp(playeridplipsizeof(plip)); 
    
format(connected,sizeof(connected),"{00ff00}[Join]:{0000ff}%s {ff0000}Has Joined The Server{00ffff}[{ffffff}IP:{ffff00}%s{00ffff}]{00ffff}[{ffffff}Contry:{ffff00}%s{00ffff}]{00ffff}[{fffff00}City: %s{00ffff}]",plname,plip,Country,City); 
    
SendClientMessageToAll(0xFF0000FF,connected); 
    return 
1

Why did you have [MAX_PLAYER_NAME] in "plip[126],Country[126],City[126]; "?
It should be string value inthere..
Reply
#6

Quote:
Originally Posted by kalanerik99
Посмотреть сообщение
PHP код:
public OnPlayerConnect(playerid

    new 
connected[256],plname[MAX_PLAYER_NAME],plip[126],Country[126],City[126]; 
    
GetPlayerCountry(playeridCountrysizeof(Country)); 
    
GetPlayerCity(playerid,Citysizeof(City)); 
    
GetPlayerName(playeridplnamesizeof(plname)); 
    
GetPlayerIp(playeridplipsizeof(plip)); 
    
format(connected,sizeof(connected),"{00ff00}[Join]:{0000ff}%s {ff0000}Has Joined The Server{00ffff}[{ffffff}IP:{ffff00}%s{00ffff}]{00ffff}[{ffffff}Contry:{ffff00}%s{00ffff}]{00ffff}[{fffff00}City: %s{00ffff}]",plname,plip,Country,City); 
    
SendClientMessageToAll(0xFF0000FF,connected); 
    return 
1

Not Work don't show
Reply
#7

try the new code I fixed it ...

Код:
public OnPlayerConnect(playerid)  
{  
    new connected[256],plname[MAX_PLAYER_NAME],plip[126],Country[126],City[126];  
    GetPlayerCountry(playerid, Country, sizeof(Country));  
    GetPlayerCity(playerid,City, sizeof(City));  
    GetPlayerName(playerid, plname, sizeof(plname));  
    GetPlayerIp(playerid, plip, sizeof(plip));  
    format(connected,sizeof(connected),"{00ff00}[Join]:{0000ff}%s {ff0000}Has Joined The Server{00ffff}[{ffffff}IP:{ffff00}%s{00ffff}]{00ffff}[{ffffff}Contry:{ffff00}%s{00ffff}]{00ffff}[{fffff00}City: %s{00ffff}]",plname,plip,Country,City);  
    SendClientMessageToAll(0xFF0000FF,connected);  
    return 1;  

}
Reply
#8

Not Work the message don't show
Reply
#9

Quote:
Originally Posted by HoussamMaroc
Посмотреть сообщение
hhhhhhhh that is not the prob because
PHP код:
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase 
the prob in new connect[999];
the problem is not there but dont use 999 use 128

and also i told you the problem is in

SendClientMessageToAll(playerid, connected); this is not how you use SendClientMessageToAll

SendClientMessageToAll(color, const message[]);

example:

PHP код:
SendClientMessageToAll(0xFF0000FF"Red"); 
you used

PHP код:
SendClientMessageToAll(playeridconnected); //connected is ok but playerid is wrong it will send the message with the color of the playerid id wich is 0-1000 depends on your server max and that why you dont see the message because the color is invalid 
Reply
#10

Quote:
Originally Posted by Whatname
Посмотреть сообщение
SendClientMessageToAll(playerid, connected); this is not how you use SendClientMessageToAll

SendClientMessageToAll(color, const message[]);

example:

PHP код:
SendClientMessageToAll(0xFF0000FF"Red"); 
you used

PHP код:
SendClientMessageToAll(playeridconnected); //connected is ok but playerid is wrong it will send the message with the color of the playerid id wich is 0-1000 depends on your server max and that why you dont see the message because the color is invalid 
bro i fix that prob but he don't show playerid = -1 in SendClientMessageToAll
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)