Some help please?
#1

When i try to take order from hq hitman, this comand don't work for this group, i need some help. Please.
PHP код:
CMD:order(playeridparams[])
{
    if(
playerVariables[playerid][pGunLicense] >= 1)
    {
        if(
playerVariables[playerid][pGroup] == || playerVariables[playerid][pGroup] == || playerVariables[playerid][pGroup] == || playerVariables[playerid][pGroup] == || playerVariables[playerid][pGroup] == 10 || playerVariables[playerid][pGroup] == 11)
        {
            new 
amount;
            if(
sscanf(params"d",amount))
            {
                
SendClientMessage(playeridCOLOR_GREYSYNTAX_MESSAGE"/order [item]");
                
SendClientMessage(playeridCOLOR_GREY"Order 1: Deagle");
                
SendClientMessage(playeridCOLOR_GREY"Order 2: AK47");
                
SendClientMessage(playeridCOLOR_GREY"Order 3: M4A1");
                
SendClientMessage(playeridCOLOR_GREY"Order 4: MP5");
                
SendClientMessage(playeridCOLOR_GREY"Order 5: Rifle");
            }
            else if(
IsPlayerConnectedEx(playerid))
            {
                if(
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] >= 5000)
                {
                    if(
playerVariables[playerid][pMoney] >= 2000)
                    {
                        if(
IsPlayerInRangeOfPoint(playerid100.0groupVariables[playerVariables[playerid][pGroup]][gGroupInteriorPos][0], groupVariables[playerVariables[playerid][pGroup]][gGroupInteriorPos][1], groupVariables[playerVariables[playerid][pGroup]][gGroupInteriorPos][2]))
                        {
                            if(
amount == 1)
                            {
                                
GivePlayerWeapon(playerid249999);
                                
playerVariables[playerid][pWeapons][0] = 24;
                                
playerVariables[playerid][pMoney] -= 1000;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] -= 500;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][0] += 1000;
                                
SCM(playeridCOLOR_WHITE,"Ai cumparat un Deagle cu 1.000$. 500 de materiale au fost retrase din seiful factiunii.");
                            }
                            else if(
amount == 2)
                            {
                                
GivePlayerWeapon(playerid309999);
                                
playerVariables[playerid][pWeapons][1] = 30;
                                
playerVariables[playerid][pMoney] -= 1250;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] -= 750;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][0] += 1250;
                                
SCM(playeridCOLOR_WHITE,"Ai cumparat un AK47 cu 1.250$. 750 de materiale au fost retrase din seiful factiunii.");
                            }
                            else if(
amount == 3)
                            {
                                
GivePlayerWeapon(playerid319999);
                                
playerVariables[playerid][pWeapons][2] = 31;
                                
playerVariables[playerid][pMoney] -= 1500;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] -= 1000;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][0] += 1500;
                                
SCM(playeridCOLOR_WHITE,"Ai cumparat un M4A1 cu 1.500$. 1.000 de materiale au fost retrase din seiful factiunii.");
                            }
                            else if(
amount == 4)
                            {
                                
GivePlayerWeapon(playerid299999);
                                
playerVariables[playerid][pWeapons][3] = 29;
                                
playerVariables[playerid][pMoney] -= 1750;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] -= 1500;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][0] += 1750;
                                
SCM(playeridCOLOR_WHITE,"Ai cumparat un MP5 cu 1.750$. 1.500 de materiale au fost retrase din seiful factiunii.");
                            }
                            else if(
amount == 5)
                            {
                                
GivePlayerWeapon(playerid339999);
                                
playerVariables[playerid][pWeapons][4] = 33;
                                
playerVariables[playerid][pMoney] -= 2000;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] -= 1750;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][0] += 2000;
                                
SCM(playeridCOLOR_WHITE,"Ai cumparat un Riffle cu 2.000$. 1.750 de materiale au fost retrase din seiful factiunii.");
                            }
                            else
                            {
                                
SCM(playerid,COLOR_WHITE,"Invalid order id.");
                            }
                        }
                    }
                    else return 
SCM(playeridCOLOR_WHITE"Nu ai destui bani.");
                }
                else return 
SCM(playeridCOLOR_WHITE"Nu poti cumpara arme deoarece factiunea ta nu are suficiente materiale.");
            }
        }
        if(
playerVariables[playerid][pGroup] == 12)
        {
            if(
IsPlayerInRangeOfPoint(playerid35.0773.8241,-49.5217,1000.5859))
            {
                
GivePlayerWeapon(playerid349999);
                
GivePlayerWeapon(playerid239999);
                
GivePlayerWeapon(playerid49999);
                
playerVariables[playerid][pWeapons][0] = 34;
                
playerVariables[playerid][pWeapons][1] = 23;
                
playerVariables[playerid][pWeapons][2] = 4;
            }
        }
    }
    else
    {
        
SCM(playeridCOLOR_TEAL"You don't have the gun license");
    }
    return 
1;
}
public 
OnPlayerGiveDamage(playeriddamagedidFloatamountweaponidbodypart)
{
    new 
string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME];
    new 
weaponname[24];
    
GetPlayerName(playeridattackersizeof (attacker));
    
GetPlayerName(damagedidvictimsizeof (victim));
    
GetWeaponName(weaponidweaponnamesizeof (weaponname));
    foreach(
Playerz)
    {
        if(
playerVariables[z][pSpectating] == playerid)
        {
            
format(stringsizeof(string), "%s has made %.0f damage to %s, weapon: %s"attackeramountvictimweaponname);
            
SendClientMessage(z,COLOR_REDstring);
        }
    }
    return 
1;

Reply
#2

Hello!

Can you give us some more information, e.g. what happens, what not?
Reply
#3

To explain you. All members of gangs, like Ballas can take weapons with this command /order but Hitmans can't.
When hitmans try to type /order, they don't take any weapon. I want to fix this.
Reply
#4

Ok, sorry for my questions but I want to help you.
Which group is hitman?
Reply
#5

Hitman Agency group on my gamemode is group 12.
Reply
#6

So, you had a logic mistake. :P
Write it like this:
PHP код:
CMD:order(playeridparams[])
{
    if(
playerVariables[playerid][pGunLicense] >= 1)
    {
        if(
playerVariables[playerid][pGroup] == 12)
        {
            new 
amount;
            if(
sscanf(params"d",amount))
            {
                
SendClientMessage(playeridCOLOR_GREYSYNTAX_MESSAGE"/order [item]");
                
SendClientMessage(playeridCOLOR_GREY"Order 1: Deagle");
                
SendClientMessage(playeridCOLOR_GREY"Order 2: AK47");
                
SendClientMessage(playeridCOLOR_GREY"Order 3: M4A1");
                
SendClientMessage(playeridCOLOR_GREY"Order 4: MP5");
                
SendClientMessage(playeridCOLOR_GREY"Order 5: Rifle");
            }
            else if(
IsPlayerConnectedEx(playerid))
            {
                if(
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] >= 5000)
                {
                    if(
playerVariables[playerid][pMoney] >= 2000)
                    {
                        if(
IsPlayerInRangeOfPoint(playerid100.0groupVariables[playerVariables[playerid][pGroup]][gGroupInteriorPos][0], groupVariables[playerVariables[playerid][pGroup]][gGroupInteriorPos][1], groupVariables[playerVariables[playerid][pGroup]][gGroupInteriorPos][2]))
                        {
                            if(
amount == 1)
                            {
                                
GivePlayerWeapon(playerid249999);
                                
playerVariables[playerid][pWeapons][0] = 24;
                                
playerVariables[playerid][pMoney] -= 1000;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] -= 500;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][0] += 1000;
                                
SCM(playeridCOLOR_WHITE,"Ai cumparat un Deagle cu 1.000$. 500 de materiale au fost retrase din seiful factiunii.");
                            }
                            else if(
amount == 2)
                            {
                                
GivePlayerWeapon(playerid309999);
                                
playerVariables[playerid][pWeapons][1] = 30;
                                
playerVariables[playerid][pMoney] -= 1250;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] -= 750;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][0] += 1250;
                                
SCM(playeridCOLOR_WHITE,"Ai cumparat un AK47 cu 1.250$. 750 de materiale au fost retrase din seiful factiunii.");
                            }
                            else if(
amount == 3)
                            {
                                
GivePlayerWeapon(playerid319999);
                                
playerVariables[playerid][pWeapons][2] = 31;
                                
playerVariables[playerid][pMoney] -= 1500;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] -= 1000;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][0] += 1500;
                                
SCM(playeridCOLOR_WHITE,"Ai cumparat un M4A1 cu 1.500$. 1.000 de materiale au fost retrase din seiful factiunii.");
                            }
                            else if(
amount == 4)
                            {
                                
GivePlayerWeapon(playerid299999);
                                
playerVariables[playerid][pWeapons][3] = 29;
                                
playerVariables[playerid][pMoney] -= 1750;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] -= 1500;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][0] += 1750;
                                
SCM(playeridCOLOR_WHITE,"Ai cumparat un MP5 cu 1.750$. 1.500 de materiale au fost retrase din seiful factiunii.");
                            }
                            else if(
amount == 5)
                            {
                                
GivePlayerWeapon(playerid339999);
                                
playerVariables[playerid][pWeapons][4] = 33;
                                
playerVariables[playerid][pMoney] -= 2000;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] -= 1750;
                                
groupVariables[playerVariables[playerid][pGroup]][gSafe][0] += 2000;
                                
SCM(playeridCOLOR_WHITE,"Ai cumparat un Riffle cu 2.000$. 1.750 de materiale au fost retrase din seiful factiunii.");
                            }
                            else
                            {
                                
SCM(playerid,COLOR_WHITE,"Invalid order id.");
                            }
                        }
                    }
                    else return 
SCM(playeridCOLOR_WHITE"Nu ai destui bani.");
                }
                else return 
SCM(playeridCOLOR_WHITE"Nu poti cumpara arme deoarece factiunea ta nu are suficiente materiale.");
            }
        }
    }
    else
    {
        
SCM(playeridCOLOR_TEAL"You don't have the gun license");
    }
    return 
1;

Reply
#7

Is not good. I want at group 12 Hitman, 24- sniper, 4- knife and 24- sd pistol and for gangs: deagle, ak47, m4, rifle and mp5. What i want to say it is, i want to put in one command 2 commands for 2 different factions, gangs and hitman.
Reply
#8

I need another solution, what you give me is not right.
Reply
#9

I... I don't understand your question... What do you EXACTLY mean?
Reply
#10

I want to be used as a command to several factors, namely the hitman agency, and the mafias that Ballas, Loz Astecas, Groove Street and so on. When you have to order hitman sniper SD pistol and a knife, and at mafias have M4, AK47, MP5 rifle and Deagle.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)