//topo gm
new Plon;
//onplayerconnect
Plon++;
//onplayerdisconnect
Plon--;
new ponline = 0;
new TotalSlots;
new Text:PlayersON;
new atualizarplayers;
atualizarplayers = SetTimer("AttPlayersON",1500,1);// Settimer de atualizar os Players ONLINE
PlayersON = TextDrawCreate(504.000000, 398.000000, "Players On: --/--");
TextDrawBackgroundColor(PlayersON, 255);
TextDrawFont(PlayersON, 1);
TextDrawLetterSize(PlayersON, 0.300000, 1.499999);
TextDrawColor(PlayersON, 16711935);
TextDrawSetOutline(PlayersON, 1);
TextDrawSetProportional(PlayersON, 1);
KillTimer(atualizarplayers);
forward AttPlayersON(playerid);
public AttPlayersON(playerid)
{
for(new dj = 0; dj < MAX_PLAYERS; dj++)
{
format(String, 30, "Players On: %d/%d", ponline, TotalSlots);
TextDrawSetString(PlayersON, String);
TextDrawShowForPlayer(playerid, PlayersON);
}
return 1;
}
// Topo do gamemode!
new Jogadores; // Variбvel que vai aumentar/diminuir quando os jogadores entrar/sair.
public OnPlayerConnect(playerid)
{
Jogadores ++; // Variбvel que vai aumentar e vai mandar na mensagem, quantos jogadores tem online.
GetPlayerName(playerid, name, sizeof(name); // Para pegar o nome do jogador.
format(string, sizeof(string), "~ O jogador %s й o jogador nъmero %d а ficar online no servidor!", name, Jogadores); // format para informaзхes avanзadas, usando as variбveis que definimos.
SendClientMessageToAll(-1, string); // Para mandar a mensagem para todos os jogadores.
return 1;
}
public OnPlayerDisconnect(playerid)
{
Jogadores --; // Quando o jogador sair do servidor, irб diminuir os jogadores que estб online -1.
return 1;
}
GetPlayers()
{
new i, count;
while( i++ < MAX_PLAYERS )
{
if(IsPlayerConnected( i ))
count++;
}
return count;
}
// Final do GM
stock JogadoresOnline()
{
new r = 0;
for(new i, j = GetMaxPlayers(); i < j; ++i)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i)) ++r;
}
return r;
}
// OnPlayerCommandText
if (strcmp("/playersonline", cmdtext, true) == 0)
{
new CelulasE[128];
format(CelulasE, sizeof(CelulasE), "Players Online: (%d/%i)",JogadoresOnline(), GetMaxPlayers());
SendClientMessage(playerid, -1, CelulasE);
return true;
}
forward AttPlayersON(playerid);
public AttPlayersON(playerid)
{
for(new dj = 0; dj < MAX_PLAYERS; dj++)
{
format(String, 30, "Players On: %d/%i", ponline, GetMaxPlayers());
TextDrawSetString(PlayersON, String);
TextDrawShowForPlayer(playerid, PlayersON);
}
return 1;
}
if(pickupid == pickupinfo) { // Pickup definido new infoserver[900]; strcat(infoserver, "{00FF00}Game Mode:{FFFF00}v1.0\n"); strcat(infoserver, "{00FF00}Donos:{FFFF00}[Gv]_.ReDKiiL_.[HS] e [ZNS]MAGNETO[Gv]\n"); strcat(infoserver, "{00FF00}Blog:{FFFF00}www.hunterserver.co.cc\n "); strcat(infoserver, "{00FF00}Comandos:{FFFF00}/comandos\n"); strcat(infoserver, "{00FF00}Teleportes:{FFFF00}/teles\n"); strcat(infoserver, "{00FF00}Regras:{FFFF00}/regras\n"); strcat(infoserver, "{00FF00}Tipo De Jogo:{FFFF00}DM/4FUN\n"); strcat(infoserver, "{00FF00}Desde:{FFFF00}**/**/****\n"); strcat(infoserver, "{00FF00}Players Online: {FFFF00}(%d/%i)",JogadoresOnline(), GetMaxPlayers());//Linha Com o Warning strcat(infoserver, "{00FF00}GameMode FeitoPor:{FFFF00}ReDKiiL,Pitty,\n{00FF00}Com Ajuda De :{FFFF00}SA:MP Fуrum,JFS,ViniBorn,Josma_CMD,Shickcard,Programador SAMP\n"); strcat(infoserver, "\t{00FF00}Tenha {FFFF00}Um Bom{00FF00} Jogo"); ShowPlayerDialog(playerid, 1225, DIALOG_STYLE_MSGBOX, "Info Server:", infoserver, "Fechar", ""); } |
D:\Usuarios\Desktop\HunterServer2011\gamemodes\HSG M.pwn(3179) : warning 202: number of arguments does not match definition Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning. |
new infoserver[100];
format(infoserver, sizeof(infoserver), "Players Online: (%d/%i)",JogadoresOnline(), GetMaxPlayers())
ShowPlayerDialog(playerid, 1225, DIALOG_STYLE_MSGBOX, "Info Server", infoserver, "Fechar", "");