Command Like /allhunt
#2

pawn Код:
new
        bool:Hunt[ MAX_PLAYERS ]
;
public OnPlayerConnect(playerid)
{
    Hunt[ playerid ] = false;
    return 1;
}

CMD:allhunt( playerid, params[] )
{
    new
            id, str[ 144 ], name[ MAX_PLAYER_NAME - 1 ]
    ;
    if( sscanf( params, "u", id ) ) return SendClientMessage( playerid , -1 , "Syntax: /allhunt <playerid/name>" );
    if( !IsPlayerConnected( id ) ) return SendClientMessage ( playerid, -1, "Player is not connected" );
    if( Hunt [ id ] == true ) return SendClientMessage( playerid, -1, "Already activated." );
    GetPlayerName( id, name, sizeof( name ) ) ;
    Hunt[ id ] = true;
    SetPlayerHealth( id, 100 ) ;
    SetPlayerArmour( id , 100 );
    format( str, sizeof( str ) , "All hunt %s..", name );
    SendClientMessageToAll( -1 , str ) ;
    return true;
}
public OnPlayerDeath(playerid, killerid, reason)
{
    if( Hunt[ playerid ] == true )
    {
        GivePlayerMoney( killerid, 100 ); //Give him the reward you want.
        Hunt[ playerid ] = false;
    }
    return 1;
}
I just gave you the basic idea, you may search for other stuff and make it yourself. you may search for the gettime() function to make it available for use every 2 hours.
Reply


Messages In This Thread
Command Like /allhunt - by Lukex - 09.07.2015, 22:58
Re: Command Like /allhunt - by SilentSoul - 10.07.2015, 01:03

Forum Jump:


Users browsing this thread: 2 Guest(s)