05.03.2011, 14:49
Can someone remake this? it bugs my MySQL things..
And when my brother(Abc123) connect it says Unknown123
Extra:
And when my brother(Abc123) connect it says Unknown123
pawn Код:
public OnPlayerConnect(playerid)
{
new servername[25], string[128];
GetServerVarAsString("hostname", servername, sizeof(servername));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerAdmin(i) || PlayerData[i][AdminLevel] > 1)
{
format(string, sizeof(string), "%s(%d) Has Joined %s. (IP: %s)", PlayerName(i), i, servername, PlayerIP(i));
SendClientMessage(i, COLOR_GREY, string);
SendDeathMessage(playerid, INVALID_PLAYER_ID, 200);
return 1;
}
else
{
format(string, sizeof(string), "%s(%d) Has Joined %s.", PlayerName(i), i, servername);
SendClientMessage(i, COLOR_GREY, string);
SendDeathMessage(playerid, INVALID_PLAYER_ID, 200);
return 1;
}
}
}
pawn Код:
stock PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}