[Ajuda] Ajuda /bonus
#8

tenta assim
PHP код:
if(strcmp(cmd,"/setarbonus",true)==0)
{
    if(
IsPlayerConnected(playerid))
    {
        if(
PlayerInfo[playerid][pLider] == 7)
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_WHITE"USE: /setarbonus [quantidade]");
                return 
1;
            }
            new 
extorcao;
            
extorcao strval(tmp);
            if(
extorcao 50 || extorcao 100) { SendClientMessage(playeridCOLOR_GREY"O Dinheiro que sera tirado pelos players no bonus nгo pode ser - que R$50 ou + que R$100"); return 1; }
            
Tax1 extorcao;
            
format(gstringsizeof(gstring), "> Bonus a ser pego por player agora sera R$%d, daqui em diante."Tax1);
            
SendClientMessage(playeridCOLOR_LIGHTBLUEgstring);
            
format(gstringsizeof(gstring), "Notнcias: O Prefeito acaba de mudar o Bonus do Dia para R$%d."Tax1);
            
SendClientMessageToAll(COLOR_LIGHTBLUEgstring);
            
dini_IntSet("CofreOrg/Org7.ini","Bonus",Tax1);
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo й o Prefeito!");
            return 
1;
        }
    }
    return 
1;
}
if (
strcmp(cmd"/bonus"true) == 0)
{
    if(
IsPlayerConnected(playerid))
    {
        if(
PlayerToPoint(5.0,playerid,358.5072,168.9830,1008.3828))
        {
            if(
PegaPresente[playerid] == 0)
            {
                 if(
dini_Int("CofreOrg/Org7.ini","Bonus") > 0)
                 {
                    new 
Bonus dini_Int("CofreOrg/Org7.ini","Bonus"); Bonus += 50;
                    
//Extas
                    
if(IsACop(playerid)){ Bonus += 50; }
                    if(
PlayerInfo[playerid][pCargo] > 0){ Bonus += 10; }
                    if(
PlayerInfo[playerid][pEmprego] > 0){ Bonus += 20; }
                    if(
PlayerInfo[playerid][pCash1] > 0){ Bonus += 100; }
                    
//
                    
if(dini_Int("CofreOrg/Org7","Total") >= Bonus)
                    {
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        
format(stringsizeof(string), "> Prefeitura: %s acabou de pegar o seu Bonus do Dia."sendername);
                        
SendClientMessageToAll(COR_PRE,string);
                        
format(gstringsizeof(gstring), "> Prefeitura: vocк recebeu serca de R$%d de Bonus."Bonus);
                        
SendClientMessage(playerid,COR_PRE,gstring);
                        
PegaPresente[playerid] = 1;
                        
//ChecaTempoExp(playerid);
                        
PlayerInfo[playerid][pPayDay] ++;
                        
GranaRockstar(playeridBonus);
                        
Emposto=dini_Int("CofreOrg/Org7.ini","Total");
                        
Emposto-=Bonus;
                        
dini_IntSet("CofreOrg/Org7.ini","Total",Emposto);
                        return 
1;
                     }
                     else{ 
SendClientMessage(playerid,COLOR_GRAD1," O Cofre da Prefeitura nгo tem dinheiro suficiente!"); }
                 }
                 else{ 
SendClientMessage(playerid,COLOR_GRAD1," O Prefeito ainda nгo seto o valor que sera o Bonus!"); }
            }
            else{ 
SendClientMessage(playeridCOLOR_GRAD1" Vocк ja pego o bonus, espere ate o proximo PayDay para pegar novamente!!"); }
        }
        else{ 
SendClientMessage(playeridCOLOR_GRAD1" Vocк nгo estб dentro da Prefeitura!!"); }
    }
    return 
1;

Reply


Messages In This Thread
Ajuda /bonus - by zGuigui2068 - 07.04.2016, 22:39
Re: Ajuda /bonus - by Pxndx - 08.04.2016, 05:18
Re: Ajuda /bonus - by F1N4L - 08.04.2016, 11:25
Re: Ajuda /bonus - by zGuigui2068 - 08.04.2016, 18:32
Re: Ajuda /bonus - by BykiLler - 08.04.2016, 19:02
Re: Ajuda /bonus - by Pxndx - 08.04.2016, 20:44
Re: Ajuda /bonus - by zGuigui2068 - 08.04.2016, 21:46
Re: Ajuda /bonus - by Pxndx - 09.04.2016, 03:34
Re: Ajuda /bonus - by zGuigui2068 - 09.04.2016, 08:15
Re: Ajuda /bonus - by RodrigoMSR - 09.04.2016, 14:24

Forum Jump:


Users browsing this thread: 1 Guest(s)