Problem with NPC, help please
#4

I hope you already made a textdraw showing how many connected players are there..

pawn Код:
//On top of your script (Global Var)
new g_ConnectedPlayers;

//Default functions:
public OnPlayerConnect(playerid)
{
    if(!IsPlayerNPC(playerid)) g_ConnectedPlayers++;
    UpdatePlayersTextDraw();
    return 1;
}
public OnPlayerDisconnect(playerid)
{
    if(!IsPlayerNPC(playerid)) g_ConnectedPlayers--;
    UpdatePlayersTextDraw();
    return 1;
}

//new stock function, put it anywhere outside other functions
stock UpdatePlayersTextDraw()
{
    new players[32];
    format(players, sizeof players, "Players: %i/100", g_ConnectedPlayers);
    TextDrawSetString(/* TextDraw Name */, players);
}
Reply


Messages In This Thread
Problem with NPC, help please - by Setkus - 18.08.2011, 16:35
Re: Problem with NPC, help please - by iPLEOMAX - 18.08.2011, 16:37
Re: Problem with NPC, help please - by Setkus - 18.08.2011, 16:42
Re: Problem with NPC, help please - by iPLEOMAX - 18.08.2011, 16:54

Forum Jump:


Users browsing this thread: 1 Guest(s)