Loops through players
#1

Im trying to learn how to loop and stuff like that. And i can't get this to work!

pawn Код:
stock GetName( playerid )
{
    new Name[ MAX_PLAYER_NAME ];
   
    if( IsPlayerConnected( playerid ) )
    {
        GetPlayerName( playerid, Name, sizeof( Name ) );
    }
    else
    {
        Name = "Disconnected/Nothing";
    }
   
    return Name;
}
pawn Код:
forward GAPoint( playerid );
public GAPoint( playerid )
{
    new string[ 128 ];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        format( string, sizeof( string ), "** %s Won! **", GetName( i ) );
        SendClientMessageToAll(YELLOW, string);
    }
}
Ingame it just says "** Disconnected/Nothing Won! **" and spams it.
Reply


Messages In This Thread
Loops through players - by The Woody - 04.04.2011, 11:10
Re: Loops through players - by Whizion - 04.04.2011, 11:17
Re: Loops through players - by The Woody - 04.04.2011, 11:20
Re: Loops through players - by The Woody - 04.04.2011, 12:05
Re: Loops through players - by Sascha - 04.04.2011, 12:31
Re: Loops through players - by The Woody - 04.04.2011, 12:41

Forum Jump:


Users browsing this thread: 1 Guest(s)