SA-MP Forums Archive
problem with the connection message - 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: problem with the connection message (/showthread.php?tid=648785)



problem with the connection message - wallen - 28.01.2018

PHP код:
    new name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    
format(stringsizeof(string), "{ffff66}(INFO) %s (ID %d) has joined the server"nameplayerid);
    
SendClientMessageToAll(-1string); 
when i join the server as id 0 i can see my connection message, but when i join as id 1 i can't see my connection message but others can see it, but not me, whats the problem?


Re: problem with the connection message - iSteve - 28.01.2018

Код:
  new name[MAX_PLAYER][MAX_PLAYER_NAME]; 
    GetPlayerName(playerid, name[playerid], MAX_PLAYER_NAME); 
    format(string, sizeof(string), "{ffff66}(INFO) %s (ID %d) has joined the server", name, playerid); 
    SendClientMessageToAll(-1, string);



Re: problem with the connection message - wallen - 28.01.2018

Quote:
Originally Posted by iSteve
Посмотреть сообщение
Код:
  new name[MAX_PLAYER][MAX_PLAYER_NAME]; 
    GetPlayerName(playerid, name[playerid], MAX_PLAYER_NAME); 
    format(string, sizeof(string), "{ffff66}(INFO) %s (ID %d) has joined the server", name, playerid); 
    SendClientMessageToAll(-1, string);
Код:
C:\Users\Wallen\Desktop\Los Santos DeathMatch\gamemodes\DBv1.pwn(722) : error 017: undefined symbol "MAX_PLAYER"
C:\Users\Wallen\Desktop\Los Santos DeathMatch\gamemodes\DBv1.pwn(722) : error 036: empty statement
C:\Users\Wallen\Desktop\Los Santos DeathMatch\gamemodes\DBv1.pwn(723) : error 017: undefined symbol "name"
C:\Users\Wallen\Desktop\Los Santos DeathMatch\gamemodes\DBv1.pwn(723) : warning 215: expression has no effect
C:\Users\Wallen\Desktop\Los Santos DeathMatch\gamemodes\DBv1.pwn(723) : error 001: expected token: ";", but found "]"
C:\Users\Wallen\Desktop\Los Santos DeathMatch\gamemodes\DBv1.pwn(723) : error 029: invalid expression, assumed zero
C:\Users\Wallen\Desktop\Los Santos DeathMatch\gamemodes\DBv1.pwn(723) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.



Re: problem with the connection message - iSteve - 28.01.2018

Код:
new name[MAX_PLAYERS][MAX_PLAYER_NAME]; 
    GetPlayerName(playerid, name[playerid], MAX_PLAYER_NAME); 
    format(string, sizeof(string), "{ffff66}(INFO) %s (ID %d) has joined the server", name, playerid); 
    SendClientMessageToAll(-1, string);



Re: problem with the connection message - wallen - 28.01.2018

https://i.imgur.com/E2rgcdQ.jpg

First yellow line is the connection message, but still, its id 0, if let join 1 bot and join as id 1 i wont see the connection message even if its totally wrong,.. meh lol


Re: problem with the connection message - iSteve - 28.01.2018

Quote:

public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME];
new string[120];

GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"%s has Join the server.");
SendClientMessage(playerid,-1,string);
return 1;
}

Will work


Re: problem with the connection message - wallen - 28.01.2018

Thanks