SA-MP Forums Archive
Problem in circling players! Help needed :) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem in circling players! Help needed :) (/showthread.php?tid=481265)



Deleted. - iFiras - 14.12.2013

Deleted.


Respuesta: Problem in circling players! Help needed :) - Cerealguy - 15.12.2013

pawn Код:
if(sscanf(params,"us[100]",CTime))
change to
pawn Код:
if(sscanf(params,"d",CTime))



Deleted. - iFiras - 15.12.2013

Deleted.


Re: Problem in circling players! Help needed :) - Patrick - 15.12.2013

Quote:
Originally Posted by iFiras
Посмотреть сообщение
Doesn't work
Any other replies?
Yes, there is another reply :P, try this code

pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>

new
    CircleAllTime, CTimer;

dcmd_circleall( playerid,params [] )
{
    new CTime, Position[3];
    if( AdminLevel[ playerid ] < 4 )
        return SCM( playerid, -1, "{FF0000}[ERROR] {FFFFFF}You don't have an appropriate administration level to use this command." );
   
    if( sscanf( params,"i", CTime ) )
        return SCM(playerid,-1,""COL_ORANGE"[USAGE] {FFFFFF}/circleall [Time]");

    if( CircleAllTime >= 1 )
        return SCM( playerid,-1,"{FF0000}[ERROR] {FFFFFF}This option is already activated." );

    GetPlayerPos(playerid, Position[ 0 ], Position[ 1 ], Position[ 2 ]);

    for( new i = 0; i < MAX_PLAYERS; i++ )
    {
        if(gTeam[ i ] != TEAM_COP || gTeam[ i ] != TEAM_ARMY || gTeam[ i ] != TEAM_FBI || gTeam[ i ] != TEAM_CIA && JailTime[ i ] <= 1) continue;
   
        CircleAllTime = CTime;
        CTimer = SetTimer( "CircleAllCountdown", 1000, true );
       
        SetPlayerPos(i, Position[ 0 ], Position[ 1 ], Position[ 2 ]);
        TogglePlayerControllable( i, 0 );
    }
    return true;
}

forward CircleAllCountdown( );
public CircleAllCountdown( )
{
    new
        string[ 15 ];
 
    CircleAllTime --;

    format( string,sizeof( string ),"~y~%d", CircleAllTime );
    GameTextForAll( string, 1000, 3 );

    if( CircleAllTime <= 0 )
    {
        GameTextForAll( "~g~~h~GO!", 4000, 3 );
        KillTimer( CTimer );
        for( new i = 0; i < MAX_PLAYERS; i++ )
        {
            if ( !IsPlayerConnected( i ) ) continue;

            TogglePlayerControllable( i, 1 );
        }
    }
    return true;
}



Deleted. - iFiras - 15.12.2013

Deleted.