SA-MP Forums Archive
Message Not Work - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Message Not Work (/showthread.php?tid=635662)



Message Not Work - HoussamMaroc - 11.06.2017

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


Re: Message Not Work - Whatname - 11.06.2017

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?


Re: Message Not Work - HoussamMaroc - 11.06.2017

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


Re: Message Not Work - HoussamMaroc - 11.06.2017

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


Re: Message Not Work - kalanerik99 - 11.06.2017

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


Re: Message Not Work - HoussamMaroc - 11.06.2017

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


Re: Message Not Work - kalanerik99 - 11.06.2017

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;  

}



Re: Message Not Work - HoussamMaroc - 11.06.2017

Not Work the message don't show


Re: Message Not Work - Whatname - 11.06.2017

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 



Re: Message Not Work - HoussamMaroc - 11.06.2017

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