Question Help: Command limited, with gettickcount or gettime
#6

Quote:
Originally Posted by leonardo1434
View Post
pawn Code:
public OnFilterScriptInit()
{
    new n = -1,time = gettime() + 5;
    while(1 != n)
    {
        if(time > gettime()) printf("lol it works.");
    }
}
With this code, it gonna spam the console saying it works until the little time over. it proofs, you did something wrong.


using the same logic, but with gettickcount it will spam for 10 seconds.
pawn Code:
public OnFilterScriptInit()
{
    new n = -1,time = GetTickCount() + 1000*10;
    while(1 != n)
    {
        if(time > GetTickCount()) printf("lol it works.");
    }
}
just try, re-look at what you did, if you copied right.
tested this.. and don't work. when type the command send me the message test..

pawn Code:
new
         mvID,
         time = GetTickCount() + 1000*10
     ;

     if(time > GetTickCount()) SendClientMessage(playerid, -1, "Test ?");
   
     if ( sscanf( params, "d", mvID ) ) return SendClientMessage( playerid, -1, "* /world <0-99>" );
     if ( mvID < 0 || mvID > 99 ) return SendClientMessage( playerid, -1, "* <0-99>" );
     
     SetPlayerVirtualWorld( playerid, mvID );

     for ( new i = 0; i < 92; i++ ) SendClientMessage( playerid, -1, " " );
     
     format( string, sizeof ( string), "* You are now in virtual world %d", mvID );
     SendClientMessage( playerid, -1, string );
     
     for ( new i = 0; i < 6; i++ ) SendClientMessage( playerid, -1, " " );
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)