How do i put this together.. ((Cmds))
#3

Quote:
Originally Posted by Dwane
Посмотреть сообщение
You can type
pawn Код:
/search
// Displays About Food
// OR
/search <Ammu/Base>

// --
/search ammu
// Displays About Ammunation
/search base
// Displays About Bases
pawn Код:
CMD:search( playerid, params[ ] )
{
    if( isnull( params ) )
    {
        if( hung_IsPlayerAthunger( playerid ) )
        {
            if( isfilling[ playerid ] ) return SendClientMessage( playerid, 0xFFC800FF, "You are already eating!" );
            if( hungers[ playerid ] > 80 ) return SCM( playerid, red, "You are not hungry!" );
            TogglePlayerControllable( playerid, 0 );
            isfilling[ playerid ] = 1;
            timerfill[ playerid ] = SetTimerEx( "timer_fill", 5500, true, "i", playerid ); //setting refueltimer
        }
    }
    if( !strcmp( params, "ammu", true ) )
    {
        if( isfilling[ playerid ] ) return SendClientMessage( playerid, 0xFFC800FF, "You are already searching!" );
        if( !ammu_IsPlayerAtammu( playerid ) ) return SendClientMessage( playerid, red, "You are not at a ammunation!" );
        TogglePlayerControllable( playerid, 0 );
        timerammu[ playerid ] = SetTimerEx( "timer_ammu", 5000, true, "i", playerid ); //setting refueltimer
        isfilling[ playerid ] = 1; //resetting anti-spam thingy :3
    }
    else if( !strcmp( params, "base", true ) )
    {
        if( isfilling[ playerid ] ) return SendClientMessage( playerid, 0xFFC800FF, "You are already searching!" );
        if( !base_IsPlayerAtme( playerid ) ) return SendClientMessage( playerid, red, "You are not at the base!" );
        TogglePlayerControllable(p layerid, 0 );
        isfilling[ playerid ] = 1; //resetting anti-spam thingy :3
        timerbase[ playerid ] = SetTimerEx( "timer_base", 5000, true, "i", playerid ); //setting refueltimer
    }
    else SendClientMessage( playerid, -1, "Usage: /search OR /search <Ammu/Base>" );
    return 1;
}
But what if i just want it to be 1 command not with params ?
Reply


Messages In This Thread
How do i put this together.. ((Cmds)) - by demonarn - 06.02.2012, 13:07
Re: How do i put this together.. ((Cmds)) - by Konstantinos - 06.02.2012, 13:28
Re: How do i put this together.. ((Cmds)) - by demonarn - 06.02.2012, 13:36
Re: How do i put this together.. ((Cmds)) - by demonarn - 07.02.2012, 14:04
Re: How do i put this together.. ((Cmds)) - by demonarn - 08.02.2012, 13:04
Re: How do i put this together.. ((Cmds)) - by demonarn - 09.02.2012, 15:51
Re: How do i put this together.. ((Cmds)) - by Konstantinos - 09.02.2012, 15:56
Re: How do i put this together.. ((Cmds)) - by demonarn - 09.02.2012, 17:48
Re: How do i put this together.. ((Cmds)) - by demonarn - 11.02.2012, 10:14
Re: How do i put this together.. ((Cmds)) - by [ABK]Antonio - 11.02.2012, 10:23

Forum Jump:


Users browsing this thread: 1 Guest(s)