question
#1

can i make every 100 score my player Variable increase of 1?

in a simple code? with a timer
Reply
#2

Yes u can
Reply
#3

I don't understand exactly what you're saying,you mean if a person ahs 100 score ,than u want it to increase to 101 and then to 102 at a time(defined by you)?
Reply
#4

Okey maybe i understend

pawn Код:
SetTimerEx( "LevelUp",1000,true,"i",playerid );

forward LevelUp( playerid );
public LevelUp( playerid )
{
    GetPlayerScore( playerid,SetPlayerScore( playerid )+1 );
    if( GetPlayerScore( playerid ) >= 100 )
    {
        //Your Variable
    }
    return true;
}
Reply
#5

Quote:
Originally Posted by Raimis_R
Посмотреть сообщение
Okey maybe i understend

pawn Код:
SetTimerEx( "LevelUp",1000,true,"i",playerid );

forward LevelUp( playerid );
public LevelUp( playerid )
{
    GetPlayerScore( playerid,SetPlayerScore( playerid )+1 );
    if( GetPlayerScore( playerid ) >= 100 )
    {
        //Your Variable
    }
    return true;
}
Lets say we add a single timer that loops completely through all players,
having a timer run on every single player is crazy :O
Reply
#6

Mm okey.

pawn Код:
SetTimer( "LevelUp",1000,true );

forward LevelUp(  );
public LevelUp(  )
{
    for( new playerid = 0; playerid != MAX_PLAYERS; playerid++ )
    {
        if( !IsPlayerConnected( playerid )) continue;
       
        GetPlayerScore( playerid,SetPlayerScore( playerid )+1 );
        if( GetPlayerScore( playerid ) >= 100 )
        {
            //Your Variable
        }
    }
    return true;
}
Reply
#7

not score + of 100 every 100 score .. example i have 0 score......now 89....now 100 LVL up!
now 130.....160...200 LEVEL UP .... and to infinite ..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)