[Ajuda] Comando /cadeia
#3

PHP код:
    if(strcmp(cmd"/cadeia"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /cadeia [ id ] [time(minutes)] [Motivo]");
                return 
1;
            }
            new 
target;
            
target ReturnUser(tmp);
            new 
playa;
            new 
time;
            
playa ReturnUser(tmp);
            
tmp strtok(cmdtextidx);
            
time strval(tmp);
            if (
PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(
admtrampando[playerid] < && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1350)
                {
                
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo estб trabalhando! (/jogar)");
                return 
1;
                }
                new 
offset idx;
                new 
result[64];
                new 
length strlen(cmdtext);
                while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                    {
                        
result[idx offset] = cmdtext[idx];
                        
idx++;
                }
                
result[idx offset] = EOS;
                if(!
strlen(result))
                    {
                        
SendClientMessage(playeridCOLOR_GRAD2"USE: /cadeia [Id Do Jogador] [motivo]");
                        return 
1;
                    }
                if(
IsPlayerConnected(playa))
                {
                    if(
playa != INVALID_PLAYER_ID)
                    {
                        
GetPlayerName(playagiveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        
format(stringsizeof(string), "* Voce foi preso %s."giveplayer);
                        
SendClientMessage(playeridCOLOR_LIGHTREDstring);
                        
format(stringsizeof(string), "* Voce foi preso pelo  Admin %s."sendername);
                        
SendClientMessage(playaCOLOR_LIGHTREDstring);
                        
ResetPlayerWeapons(playa);
                        
WantedPoints[playa] = 0;
                        
PlayerInfo[playa][pJailed] = 2;
                        
PlayerInfo[playa][pJailTime] = time*60;
                        
SetPlayerInterior(playa0);
                        
SetPlayerPos(playa107.2300,1920.6311,18.5208);
                        
SetPlayerWorldBounds(playa337.5694,101.5826,1940.9759,1798.7453);
                        
format(string256"Admin: %s ID(%d) Prendeu %s ID(%d) Por %d Minutos. Motivo: %s",sendernameplayeridgiveplayer,targettime, (result));
                        
SendClientMessageToAll(COLOR_LIGHTRED/*0x63C3F6AA*/string);
                        
format(stringsizeof(string), "Voce foi preso por %d Minutos em Praзa Publica.  Motivo: %s"time, (result));
                        
SendClientMessage(playaCOLOR_LIGHTBLUEstring);
                    }
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"   Voce nгo esta autorizado a usar este comando!");
            }
        }
        return 
1;
    } 
Fiz rapidao.
Reply


Messages In This Thread
[Ajuda] Comando /cadeia - by Vitor_Marfioso - 24.01.2012, 21:59
Re: [Ajuda] Comando /cadeia - by Don_Speed - 24.01.2012, 23:53
Re: [Ajuda] Comando /cadeia - by HarryPoter(Owner) - 24.01.2012, 23:54
Re: [Ajuda] Comando /cadeia - by Vitor_Marfioso - 25.01.2012, 15:05
Re: [Ajuda] Comando /cadeia - by Don_Speed - 25.01.2012, 15:22
Re: [Ajuda] Comando /cadeia - by HarryPoter(Owner) - 25.01.2012, 15:58

Forum Jump:


Users browsing this thread: 2 Guest(s)