#1

fIXED
Reply
#2

Where did you put those codes ?

and try these if works or nop

Код:
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);
Edit: or use this one, should work

Код:
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);
     }
Reply
#3

Код:
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);
1. String is way too big (I recommend 24 since an username can only be 24 chars long.)
2. Missed end quote and sizeof string = sizeof(string)
Reply
#4

Same situation
Reply
#5

Where you putting those codes ?
Reply
#6

At end of onplayerconnect
Reply
#7

Код:
at defines - #define PlayerLoop(%1) for(new %1 = 0, pMax = MAX_PLAYERS; %1 < pMax; %1++) if(IsPlayerConnected(%1) && !IsPlayerNPC(%1))
somewhere in script

Код:
stock PlayerName(playerid)
{
  new name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  return name;
}
OnPlayerConnect

Код:
PlayerLoop(i)
	{
                    new string[128];
                    format(string,sizeof(string),"% has joined the server" , PlayerName(playerid)
		    SendClientMessage(i,-1, string);
	}
Reply
#8

fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)