[Ajuda] Comando /contrato
#3

Quote:
Originally Posted by iTakelot
Посмотреть сообщение
PHP код:
    if(strcmp(cmd, "/contrato", true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp = strtok(cmdtext, idx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playerid, COLOR_GRAD1, "USE: /contrato [ID/Nome] [Quantia] [Organizaзгo(Triad ou Hitman)]");
                return 
true;
            }
            
giveplayerid = ReturnUser(tmp);
            
tmp = strtok(cmdtext, idx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playerid, COLOR_GRAD1, "USE: /contrato [ID/Nome] [Quantia] [Organizaзгo(Triad ou Hitman)]");
                return 
true;
            }
            
moneys = strval(tmp);
            
tmp = strtok(cmdtext, idx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playerid, COLOR_GRAD1, "USE: /contrato [ID/Nome] [Quantia] [Organizaзгo(Triad ou Hitman)]");
                return 
true;
            }
            if(
moneys < 10000)
            {
                
SendClientMessage(playerid, COLOR_GREY, "   Contrato Minimo 10k (10000)");
                return 
true;
            }
            if(
PlayerInfo[playerid][pLevel] < 4)
            {
                
SendClientMessage(playerid, COLOR_GRAD1, "Vocк precisa de no minimo nivel 4.");
                return 
true;
            }
            if(
GetPlayerMoney(playerid) < moneys)
            {
                
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem esta grana toda.");
                return 
true;
            }
            if (
IsPlayerConnected(giveplayerid))
            {
                if(
giveplayerid != INVALID_PLAYER_ID)
                {
                    
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    
GetPlayerName(playerid, sendername, sizeof(sendername));
                    
playermoney = GetPlayerMoneyEx(playerid);
                    if (
moneys > 0 && playermoney >= moneys)
                    {
                        if(
strcmp(tmp,"Hitman",true) == 0)
                        {
                            
GivePlayerMoneyEx(playerid, (0 - moneys));
                            
PlayerInfo[giveplayerid][pHeadValue]+=moneys;
                            
format(string, sizeof(string), "HITMANS: %s Colocou um contrato em %s, por $%d.",sendername, giveplayer, moneys);
                            
SendFamilyMessage(8, COLOR_YELLOW, string);
                            
format(string, sizeof(string), "*HITMANS: Vocк colocou um contrato em %s, por $%d.",giveplayer, moneys);
                            
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                            
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                            return 
true;
                        }
                        if(
strcmp(tmp,"triad",true) == 0)
                        {
                            
GivePlayerMoneyEx(playerid, (0 - moneys));
                            
PlayerInfo[giveplayerid][pHeadValueT]+=moneys;
                            
format(string, sizeof(string), "TRIADS: %s Colocou um contrato em %s, por $%d.",sendername, giveplayer, moneys);
                            
SendFamilyMessage(22, COLOR_YELLOW, string);
                            
format(string, sizeof(string), "*TRIADS: Vocк colocou um contrato em %s, por $%d.",giveplayer, moneys);
                            
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                            
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                            return 
true;
                        }
                        else
                        {
                            
SendClientMessage(playerid, COLOR_GRAD1, "   USE: /contrato [id] [Quantia] TRIAD ou HITMAN");
                            return 
true;
                        }
                    }
                    
format(string, sizeof(string), "   Vocк nгo tem R$%d em mгos!", moneys);
                    
SendClientMessage(playerid, COLOR_WHITE, string);
                    return 
true;
                }
                else
                {
                    
format(string, sizeof(string), "   %d nгo й um jogador ativo.", giveplayerid);
                    
SendClientMessage(playerid, COLOR_GRAD1, string);
                }
            }
        }
//not connected
        
return true;
        } 
Continuou os mesmos erros. Jб descobri aonde estava o erro, muito obrigado pela ajuda!
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)