SA-MP Forums Archive
[Ajuda] Qualquer player consegue roubar os cofres.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Qualquer player consegue roubar os cofres.. (/showthread.php?tid=387587)



Qualquer player consegue roubar os cofres.. - duuuwh - 25.10.2012

PHP Code:
if(strcmp(cmd"/roubar"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerToPoint(1.0,playerid354.9906,172.3177,1008.3794))
            {
                if(
JaEstaRoubando[playerid] == 1)
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"Vocк ja estб roubando!");
                    return 
true;
                }
                if(
storeexit[playerid] == 1717)// Pref LS (Commerce)
                
{
                    if(
TemGenteRoubandoLS == 1)
                    {
                        
SendClientMessage(playeridCOLOR_GRAD1"Alguem ja roubou este local recentemente");
                        return 
true;
                    }
                    
SetTimer("RouboPrefLS"4000000);
                     
SetPlayerPos(playerid354.9906,172.3177,1008.3794);
                    
SetPlayerFacingAngle(playerid93.9411);
                    
JaEstaRoubando[playerid] = 1;
                    
ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Rob",1.0,1,0,0,0,0);
                    
SetTimerEx("AnimRoubo"5000"i"playerid);
                    
temporoubo[playerid] = SetTimerEx("RouboPref"600000"i"playerid);
                    
TemGenteRoubandoLS 1;
                    
format(stringsizeof(string), "[ROUBO] %s (ID: %d) estб tentando roubar o cofre da prefeitura de (Commerce - LS)!"PlayerName(playerid), playerid);
                    
SendClientMessageToAll(COLOR_DBLUEstring);
                    
SendClientMessage(playeridCOLOR_YELLOW"Espere 1 minuto para roubar. USE: /parar para cancelar!");
                    
SetPlayerCriminal(playerid,255,"tentativa de roubo");
                    
ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Rob",1.0,1,0,0,0,0);
                    return 
true;
                } 
Qualquer play consegue roubar os cofres, ajudem a colocar para apenas esses id de orgs consigam roubar:

Orgs que eu queria que sу elas roubassem:

ID: 5,14,17,18,19,21

Obrigado a quem me ajudar..


Re: Qualquer player consegue roubar os cofres.. - mau.tito - 25.10.2012

Bota a definiзao da org EX:
pawn Code:
if(Player[playeri][pOrg] == 5)
{
 // a funзao do roubo
 return true;
}


@Edit definiзao do lider e membros !


Re: Qualquer player consegue roubar os cofres.. - duuuwh - 25.10.2012

Sou novato nisto, teria como detalhar mais?


Re: Qualquer player consegue roubar os cofres.. - Ouro - 25.10.2012

PHP Code:
if(strcmp(cmd"/roubar"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerToPoint(1.0,playerid354.9906,172.3177,1008.3794))
            {
                if(
PlayerInfo[playerid][pOrg] == || PlayerInfo[playerid][pOrg] == 14
                
{
                    if(
JaEstaRoubando[playerid] == 1)
                    {
                        
SendClientMessage(playeridCOLOR_GRAD1"Vocк ja estб roubando!");
                        return 
true;
                    }
                    if(
storeexit[playerid] == 1717)// Pref LS (Commerce)
                    
{
                    if(
TemGenteRoubandoLS == 1)
                    {
                        
SendClientMessage(playeridCOLOR_GRAD1"Alguem ja roubou este local recentemente");
                        return 
true;
                    }
                    
SetTimer("RouboPrefLS"4000000);
                    
SetPlayerPos(playerid354.9906,172.3177,1008.3794);
                    
SetPlayerFacingAngle(playerid93.9411);
                    
JaEstaRoubando[playerid] = 1;
                    
ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Rob",1.0,1,0,0,0,0);
                    
SetTimerEx("AnimRoubo"5000"i"playerid);
                    
temporoubo[playerid] = SetTimerEx("RouboPref"600000"i"playerid);
                    
TemGenteRoubandoLS 1;
                    
format(stringsizeof(string), "[ROUBO] %s (ID: %d) estб tentando roubar o cofre da prefeitura de (Commerce - LS)!"PlayerName(playerid), playerid);
                    
SendClientMessageToAll(COLOR_DBLUEstring);
                    
SendClientMessage(playeridCOLOR_YELLOW"Espere 1 minuto para roubar. USE: /parar para cancelar!");
                    
SetPlayerCriminal(playerid,255,"tentativa de roubo");
                    
ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Rob",1.0,1,0,0,0,0);
                    }
                    return 
true;
                } 



Re: Qualquer player consegue roubar os cofres.. - Sky™ - 25.10.2012

pegue o exemplo do carinha acima e coloque a org ou profissгo que poderб roubar o banco