[Ajuda]Ligando Comandos
#2

Olб Nake01.


Comeзo do mode:
pawn Код:
new SecondsJailed[MAX_PLAYERS];
pawn Код:
if(strcmp(cmd, "/prender", true) == 0)
        {
                new tmpp[256];
                new playername;
                tmp = strtok(cmdtext, idx);
                tmpp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                        SendClientMessage(playerid, COLOR_GREEN, "Uso correto: /prender [id do player] [segundos");
                        return 1;
                }
                giveplayerid = strval(tmp);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                new Second = strval(tmpp);
                if(logado[playerid] == 1)
                {
                    if(PlayerInfo[playerid][GAT] >= 2)
                    {
                                SecondsJailed[playerid] = Second;
                                format(string, sizeof(string), "O Oficial %s prendeu o jogador %s por %d segundo(s)", sendername,giveplayer,Second);
                                SendClientMessageToAll(COLOR_YELLOW, string);
                                SendClientMessage(playerid, COLOR_YELLOW, string);
                                format(string, sizeof(string), "~g~Preso por: ~n~~r~%s.", sendername);
                                GameTextForPlayer(giveplayerid, string, 1000, 1);
                                SetPlayerInterior(giveplayerid, 6);
                                SetPlayerPos(giveplayerid, 264.6288,77.5742,1001.0391);
                                SetPlayerArmour(giveplayerid, 0);
                                TogglePlayerControllable(giveplayerid, 1);
                                ResetPlayerWeapons(giveplayerid);
                                SetTimerEx("Unjail", Second*1000, 0, "i", giveplayerid);
                                format(file,sizeof(file),"%s.ini",playername);
                                dini_Create(file);
                                dini_IntSet(file,"Preso", 1);
                                PlayerInfo[giveplayerid][Preso] = dini_Int(file,"Preso");
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_CYAN, "Vocк nгo й um Membro do GAT !");
                        }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_CYAN, "Vocк tem que estar logado para usar este comando!");
                }
                return 1;
        }


E o outro comando:


pawn Код:
if(!strcmp(cmdtext, "/presos", true))
        {
            SendClientMessage(playerid, 0x33AAFFFF, "** Todos os PRESOS Online **");
                new count=0;
                new tmpp[256];
                tmp = strtok(cmdtext, idx);
                tmpp = strtok(cmdtext, idx);
                new Second = strval(tmpp);
                for(new i=0; i<MAX_PLAYERS; i++)
                {
                if(IsPlayerConnected(i))
                {
                    if(logado[i] == 1)
                    {
                                        if(PlayerInfo[i][Preso] >= 1)
                                        {
                                                new str[256];
                                                new pname[24];
                                                GetPlayerName(i, pname, 24);
                                                format(str, 256, "PRESO - %s - [%d Segundos] ", pname, SecondsJailed[playerid]);
                                                SendClientMessage(playerid, 0xC0C0C0FF, str);
                                                count++;
                                        }
                                }
                        }
                }
                if(count == 0)
                {
                SendClientMessage(playerid, COLOR_CYAN, "Nenhum PRESO online !");
                }
                return 1;
        }


Atenciosamente,
Falcon.
Reply


Messages In This Thread
[Ajuda]Ligando Comandos - by Nake01 - 03.07.2011, 12:36
Re: [DUV]Ligando Comandos - by Falcon. - 03.07.2011, 14:20
Re: [Ajuda]Ligando Comandos - by Nake01 - 03.07.2011, 15:30
Re: [Ajuda]Ligando Comandos - by Falcon. - 03.07.2011, 15:36
Re: [Ajuda]Ligando Comandos - by Nake01 - 03.07.2011, 15:53
Re: [Ajuda]Ligando Comandos - by Falcon. - 03.07.2011, 16:12
Re: [Ajuda]Ligando Comandos - by Nake01 - 18.07.2011, 12:30
Re: [Ajuda]Ligando Comandos - by steki. - 18.07.2011, 12:44
Re: [Ajuda]Ligando Comandos - by RockFire - 18.07.2011, 12:54
Re: [Ajuda]Ligando Comandos - by steki. - 18.07.2011, 12:59

Forum Jump:


Users browsing this thread: 1 Guest(s)