countdown cmd problem
#3

pawn Код:
public DTime(times)
{

    if(times > 0)
    {
        new string[10];
        format(string, sizeof(string), "~g~%d", times);
        GameTextForAll(string, 1300, 6);
        SetTimerEx("DTime",1000,false,"i",times-1);
    }else
        GameTextForAll("~r~GO!!!", 1000, 6);

    return 1;
}

dcmd_countdown(playerid, params[])
{
    if(isnull(params)) return SendClientMessage( playerid, -1, "{FF0099}[ADMIN]{FFFFFF}/countdown [time]" );
    if(!(0 < strval(params) < 21)) return SendClientMessage(playerid, -1, "{FF0000}[ERROR]{FFFFFF}You can start a countdown from 20 only!");

    DTime(strval(params));
    // SetTimerEx("DTime",1000,false,"i",strval(params));
    new pName[24],string[128];
    GetPlayerName(playerid,pName,24);
    format(string,sizeof(string),"{FF0099}[ADMIN]{FFFFFF}%s has initiated a countdown starting from %d",pName,strval(params));
    return SendClientMessageToAll(COLOR_ADMIN,string);
}
Reply


Messages In This Thread
countdown cmd problem - by Sojo12 - 24.03.2014, 14:52
Re: countdown cmd problem - by Konstantinos - 24.03.2014, 14:56
Re: countdown cmd problem - by Jefff - 24.03.2014, 15:50
Re: countdown cmd problem - by Hanuman - 24.03.2014, 16:16
Re: countdown cmd problem - by Sojo12 - 25.03.2014, 14:49

Forum Jump:


Users browsing this thread: 1 Guest(s)