25.01.2017, 14:34
(
Последний раз редактировалось Mijata; 25.01.2017 в 16:20.
)
fIXED
new string[128], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof(string)," %s has joined the server",pName); SendClientMessageToAll(-1,string);
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) { new string[128],pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof(string),"%s has joined to the server",pName); SendClientMessage(i,-1,string); }
new string[128], pName[MAX_PLAYER_NAME]; // 1 GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof(string)," %s has joined the server",pName); // 2 SendClientMessageToAll(-1,string);
at defines - #define PlayerLoop(%1) for(new %1 = 0, pMax = MAX_PLAYERS; %1 < pMax; %1++) if(IsPlayerConnected(%1) && !IsPlayerNPC(%1))
stock PlayerName(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); return name; }
PlayerLoop(i) { new string[128]; format(string,sizeof(string),"% has joined the server" , PlayerName(playerid) SendClientMessage(i,-1, string); }