[Ajuda] Comando /contrato
#2

PHP код:
    if(strcmp(cmd"/contrato"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD1"USE: /contrato [ID/Nome] [Quantia] [Organizaзгo(Triad ou Hitman)]");
                return 
true;
            }
            
giveplayerid ReturnUser(tmp);
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD1"USE: /contrato [ID/Nome] [Quantia] [Organizaзгo(Triad ou Hitman)]");
                return 
true;
            }
            
moneys strval(tmp);
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD1"USE: /contrato [ID/Nome] [Quantia] [Organizaзгo(Triad ou Hitman)]");
                return 
true;
            }
            if(
moneys 10000)
            {
                
SendClientMessage(playeridCOLOR_GREY"   Contrato Minimo 10k (10000)");
                return 
true;
            }
            if(
PlayerInfo[playerid][pLevel] < 4)
            {
                
SendClientMessage(playeridCOLOR_GRAD1"Vocк precisa de no minimo nivel 4.");
                return 
true;
            }
            if(
GetPlayerMoney(playerid) < moneys)
            {
                
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo tem esta grana toda.");
                return 
true;
            }
            if (
IsPlayerConnected(giveplayerid))
            {
                if(
giveplayerid != INVALID_PLAYER_ID)
                {
                    
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    
playermoney GetPlayerMoneyEx(playerid);
                    if (
moneys && playermoney >= moneys)
                    {
                        if(
strcmp(tmp,"Hitman",true) == 0)
                        {
                            
GivePlayerMoneyEx(playerid, (moneys));
                            
PlayerInfo[giveplayerid][pHeadValue]+=moneys;
                            
format(stringsizeof(string), "HITMANS: %s Colocou um contrato em %s, por $%d.",sendernamegiveplayermoneys);
                            
SendFamilyMessage(8COLOR_YELLOWstring);
                            
format(stringsizeof(string), "*HITMANS: Vocк colocou um contrato em %s, por $%d.",giveplayermoneys);
                            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                            
PlayerPlaySound(playerid10520.00.00.0);
                            return 
true;
                        }
                        if(
strcmp(tmp,"triad",true) == 0)
                        {
                            
GivePlayerMoneyEx(playerid, (moneys));
                            
PlayerInfo[giveplayerid][pHeadValueT]+=moneys;
                            
format(stringsizeof(string), "TRIADS: %s Colocou um contrato em %s, por $%d.",sendernamegiveplayermoneys);
                            
SendFamilyMessage(22COLOR_YELLOWstring);
                            
format(stringsizeof(string), "*TRIADS: Vocк colocou um contrato em %s, por $%d.",giveplayermoneys);
                            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                            
PlayerPlaySound(playerid10520.00.00.0);
                            return 
true;
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_GRAD1"   USE: /contrato [id] [Quantia] TRIAD ou HITMAN");
                            return 
true;
                        }
                    }
                    
format(stringsizeof(string), "   Vocк nгo tem R$%d em mгos!"moneys);
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                    return 
true;
                }
                else
                {
                    
format(stringsizeof(string), "   %d nгo й um jogador ativo."giveplayerid);
                    
SendClientMessage(playeridCOLOR_GRAD1string);
                }
            }
        }
//not connected
        
return true;
        } 
Reply


Messages In This Thread
Comando /contrato - by jefrens - 28.07.2015, 00:35
Re: Comando /contrato - by iTakelot - 28.07.2015, 00:50
Re: Comando /contrato - by jefrens - 28.07.2015, 01:06

Forum Jump:


Users browsing this thread: 1 Guest(s)