public OnPlayerLogin(playerid) { new playername[12]; new 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); } } }
C:\Users\Deshon\Desktop\My Servers\Server 0.3z\gamemodes\Revival-Copy.pwn(1230) : error 012: invalid function call, not a valid address C:\Users\Deshon\Desktop\My Servers\Server 0.3z\gamemodes\Revival-Copy.pwn(1230) : warning 215: expression has no effect C:\Users\Deshon\Desktop\My Servers\Server 0.3z\gamemodes\Revival-Copy.pwn(1230) : error 001: expected token: ";", but found ")" C:\Users\Deshon\Desktop\My Servers\Server 0.3z\gamemodes\Revival-Copy.pwn(1230) : error 029: invalid expression, assumed zero C:\Users\Deshon\Desktop\My Servers\Server 0.3z\gamemodes\Revival-Copy.pwn(1230) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
if(code here)
else if(code here)
format(string, sizeof(string), "blablabla", playername);
new playername[12], string[64];
if (pInfo(playerid)[pAdmin] == 0)
{
format(string,sizeof(string),"Player %s has joined the server.",playername);
SendClientMessageToAll(0xFFFFFFAA,string);
}
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;
}
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(pInfo(playerid)[pAdmin] == 2) { format(string,sizeof(string),"Cadet %s has joined the server.",playername); SendClientMessageToAll(0xFFFFFFAA,string); } else if(pInfo(playerid)[pAdmin] == 3) { format(string,sizeof(string),"Admin %s has joined the server.",playername); SendClientMessageToAll(0xFFFFFFAA,string); } else if(pInfo(playerid)[pAdmin] == 4) { format(string,sizeof(string),"Server Tech %s has joined the server.",playername); SendClientMessageToAll(0xFFFFFFAA,string); } else if(pInfo(playerid)[pAdmin] == 5) { format(string,sizeof(string),"Owner %s has joined the server.",playername); SendClientMessageToAll(0xFFFFFFAA,string); } return 1; }
pInfo(playerid)[pAdmin] //wrong
//
pInfo[playerid][pAdmin] //correct
//
pInfo[playerid][pAdmin]
GetPlayerName(playerid, playername, sizeof(playername));
yes i read the last post, but i get the players name from the pInfo which is defined in the global variables.
|