03.03.2012, 18:14
Not bad.
Still Fucked up
Код:
//---------------------------------------------------------- // PlayersConnected // Created: Febuary 7 2012 // By: Marc[Owner] //---------------------------------------------------------- #include <a_samp> #include <core> #include <float> new PlayersConnected = 0; public OnFilterScriptInit() { print("\n----------------------------------"); print("Running PlayersConnected - by Marc"); print("----------------------------------/n"); return 1; } //---------------------------------------------------------- public OnPlayerConnect(playerid) { new string[256]; PlayersConnected++; //PlayersConnected += 1; format(string, sizeof(string), "(INFO) There are currently %d people in the server!", PlayersConnected); SendClientMessageToAll(0x00000000, string); return 1; } //---------------------------------------------------------- public OnPlayerDisconnect(playerid, reason) { new string[256]; PlayersConnected--; //PlayersConnected -= 1; format(string, sizeof(string), "(INFO) There are currently %d people in the server!", PlayersConnected); SendClientMessageToAll(0x00000000, string); return 1; } //---------------------------------------------------------- Look at the error Код:
C:\Documents and Settings\EPUser\My Documents\AA- KingJ server Folder\Maps\Conect1.pwn(38) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning. |
for(new i; i < GetMaxPlayers(); i++)
for(new i; i < GetMaxPlayers(); i++) if(IsPlayerConnected(i))
for(new i; i < GetMaxPlayers(); i++) if(IsPlayerConnected(i)) PlayersConnected++;
pawn Код:
|
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
//...
}
#include <foreach>
//...
foreach(Player, i)
{
//...
}