11.05.2014, 05:10
You are stopping each if and each else if before it could start.
Never place a semicolon after:
You didn't give sizeof a value.
It should be:
You opened the function brackets after new string[64];
Local variables don't require to open brackets.
I fixed the mistakes and the indentation.
Never place a semicolon after:
pawn Код:
if(code here)
else if(code here)
It should be:
pawn Код:
format(string, sizeof(string), "blablabla", playername);
Local variables don't require to open brackets.
pawn Код:
new playername[12], string[64];
if (pInfo(playerid)[pAdmin] == 0)
{
format(string,sizeof(string),"Player %s has joined the server.",playername);
SendClientMessageToAll(0xFFFFFFAA,string);
}
pawn Код:
public OnPlayerLogin(playerid)
{
new playername[12], string[64];
if (pInfo(playerid)[pAdmin] == 0)
{
format(string,sizeof(string),"Player %s has joined the server.",playername);
SendClientMessageToAll(0xFFFFFFAA,string);
}
else if(pInfo(playerid)[pAdmin] == 1)
{
format(string,sizeof(string),"Applicant %s has joined the server.",playername);
SendClientMessageToAll(0xFFFFFFAA,string);
}
else if(IsPlayerAdmin(playerid) == 2)
{
format(string,sizeof(string),"Cadet %s has joined the server.",playername);
SendClientMessageToAll(0xFFFFFFAA,string);
}
else if(IsPlayerAdmin(playerid) == 3)
{
format(string,sizeof(string),"Admin %s has joined the server.",playername);
SendClientMessageToAll(0xFFFFFFAA,string);
}
else if(IsPlayerAdmin(playerid) == 4)
{
format(string,sizeof(string),"Server Tech %s has joined the server.",playername);
SendClientMessageToAll(0xFFFFFFAA,string);
}
else if(IsPlayerAdmin(playerid) == 5)
{
format(string,sizeof(string),"Owner %s has joined the server.",playername);
SendClientMessageToAll(0xFFFFFFAA,string);
}
return 1;
}