[Pedido] /contar [id] [quantia]
#9

Testa aн ~>

pawn Код:
// Topo do GM

new Contar[MAX_PLAYERS];

forward FicarContando(playerid);

public FicarContando(playerid)
{
    if(Contar[playerid] >= 1)
    {
        Contar[playerid]--;

        format(Fala,sizeof(Fala),"~r~Contagem: ~w~%d",Contar[playerid]);
        GameTextForPlayer(playerid,Fala,2000,3);
    }
    if(Contar[playerid] == 0)
    {
        GameTextForPlayer(playerid,"~g~Go Go Go!",2000,3);
    }
    return 1;
}

// OnGameModeInit

for(new i=0; i<MAX_PLAYERS; i++)
{
    SetTimerEx("FicarContando",1000,1,"i",i);
}

// Comando STRCMP

new cmd[128];
new tmp[128];

new idx;

cmd = strtok(cmdtext,idx);

if(strcmp(cmdtext,"/contar",true) == 0)
{
    tmp = strtok(cmdtext,idx);

    if(!strlen(tmp))
    {
        SendClientMessage(playerid,0xBFBFBFAA,"Use /contar [ID] [Tempo]");
        return 1;
    }
    new id = strval(tmp);

    if(!IsPlayerConnected(id))
    {
        SendClientMessage(playerid,0xBFBFBFAA,"Este player nгo estб conectado.");
        return 1;
    }
    new Count = strval(tmp);
   
    tmp = strtok(cmdtext,idx);
   
    if(!strlen(tmp))
    {
        SendClientMessage(playerid,0xBFBFBFAA,"Use /contar [ID] [Tempo]");
        return 1;
    }
    if(Count > 10)
    {
        SendClientMessage(playerid,0xBFBFBFAA,"Os nъmeros sу podem ser de 1 a 10.");
        return 1;
    }
    Contar[id] = Count;
    return 1;
}

// Comando ZCMD

CMD:contar(playerid,params[])
{
    new ID, Count;

    if(sscanf(params,"ud",ID,Count))
    {
        SendClientMessage(playerid,0xBFBFBFAA,"Use /contar [ID] [Tempo]");
        return 1;
    }
    if(!IsPlayerConnected(ID))
    {
        SendClientMessage(playerid,0xBFBFBFAA,"Este player nгo estб conectado.");
        return 1;
    }
    if(Count > 10)
    {
        SendClientMessage(playerid,0xBFBFBFAA,"Os nъmeros sу podem ser de 1 a 10.");
        return 1;
    }
    Contar[ID] = Count;
    return 1;
}
Espero ter ajudado
Reply


Messages In This Thread
/contar [id] [quantia] - by Suxi - 16.06.2013, 07:08
Re: /contar [id] [quantia] - by AlucardSnow - 16.06.2013, 11:37
Re: /contar [id] [quantia] - by BielCOP - 16.06.2013, 13:17
Re: /contar [id] [quantia] - by Suxi - 16.06.2013, 17:53
Re: /contar [id] [quantia] - by BielCOP - 16.06.2013, 18:17
Re: /contar [id] [quantia] - by -GooGle- - 16.06.2013, 19:23
Re: /contar [id] [quantia] - by Suxi - 16.06.2013, 19:45
Re: /contar [id] [quantia] - by -GooGle- - 16.06.2013, 20:05
Re: /contar [id] [quantia] - by BielCOP - 16.06.2013, 20:07
Re: /contar [id] [quantia] - by Schocc - 16.06.2013, 20:21

Forum Jump:


Users browsing this thread: 1 Guest(s)