21.12.2015, 17:12
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(playerid, params[])
{
if(playerVariables[playerid][pGunLicense] >= 1)
{
if(playerVariables[playerid][pGroup] == 6 || playerVariables[playerid][pGroup] == 7 || playerVariables[playerid][pGroup] == 8 || playerVariables[playerid][pGroup] == 9 || playerVariables[playerid][pGroup] == 10 || playerVariables[playerid][pGroup] == 11)
{
new amount;
if(sscanf(params, "d",amount))
{
SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/order [item]");
SendClientMessage(playerid, COLOR_GREY, "Order 1: Deagle");
SendClientMessage(playerid, COLOR_GREY, "Order 2: AK47");
SendClientMessage(playerid, COLOR_GREY, "Order 3: M4A1");
SendClientMessage(playerid, COLOR_GREY, "Order 4: MP5");
SendClientMessage(playerid, COLOR_GREY, "Order 5: Rifle");
}
else if(IsPlayerConnectedEx(playerid))
{
if(groupVariables[playerVariables[playerid][pGroup]][gSafe][1] >= 5000)
{
if(playerVariables[playerid][pMoney] >= 2000)
{
if(IsPlayerInRangeOfPoint(playerid, 100.0, groupVariables[playerVariables[playerid][pGroup]][gGroupInteriorPos][0], groupVariables[playerVariables[playerid][pGroup]][gGroupInteriorPos][1], groupVariables[playerVariables[playerid][pGroup]][gGroupInteriorPos][2]))
{
if(amount == 1)
{
GivePlayerWeapon(playerid, 24, 9999);
playerVariables[playerid][pWeapons][0] = 24;
playerVariables[playerid][pMoney] -= 1000;
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] -= 500;
groupVariables[playerVariables[playerid][pGroup]][gSafe][0] += 1000;
SCM(playerid, COLOR_WHITE,"Ai cumparat un Deagle cu 1.000$. 500 de materiale au fost retrase din seiful factiunii.");
}
else if(amount == 2)
{
GivePlayerWeapon(playerid, 30, 9999);
playerVariables[playerid][pWeapons][1] = 30;
playerVariables[playerid][pMoney] -= 1250;
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] -= 750;
groupVariables[playerVariables[playerid][pGroup]][gSafe][0] += 1250;
SCM(playerid, COLOR_WHITE,"Ai cumparat un AK47 cu 1.250$. 750 de materiale au fost retrase din seiful factiunii.");
}
else if(amount == 3)
{
GivePlayerWeapon(playerid, 31, 9999);
playerVariables[playerid][pWeapons][2] = 31;
playerVariables[playerid][pMoney] -= 1500;
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] -= 1000;
groupVariables[playerVariables[playerid][pGroup]][gSafe][0] += 1500;
SCM(playerid, COLOR_WHITE,"Ai cumparat un M4A1 cu 1.500$. 1.000 de materiale au fost retrase din seiful factiunii.");
}
else if(amount == 4)
{
GivePlayerWeapon(playerid, 29, 9999);
playerVariables[playerid][pWeapons][3] = 29;
playerVariables[playerid][pMoney] -= 1750;
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] -= 1500;
groupVariables[playerVariables[playerid][pGroup]][gSafe][0] += 1750;
SCM(playerid, COLOR_WHITE,"Ai cumparat un MP5 cu 1.750$. 1.500 de materiale au fost retrase din seiful factiunii.");
}
else if(amount == 5)
{
GivePlayerWeapon(playerid, 33, 9999);
playerVariables[playerid][pWeapons][4] = 33;
playerVariables[playerid][pMoney] -= 2000;
groupVariables[playerVariables[playerid][pGroup]][gSafe][1] -= 1750;
groupVariables[playerVariables[playerid][pGroup]][gSafe][0] += 2000;
SCM(playerid, COLOR_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(playerid, COLOR_WHITE, "Nu ai destui bani.");
}
else return SCM(playerid, COLOR_WHITE, "Nu poti cumpara arme deoarece factiunea ta nu are suficiente materiale.");
}
}
if(playerVariables[playerid][pGroup] == 12)
{
if(IsPlayerInRangeOfPoint(playerid, 35.0, 773.8241,-49.5217,1000.5859))
{
GivePlayerWeapon(playerid, 34, 9999);
GivePlayerWeapon(playerid, 23, 9999);
GivePlayerWeapon(playerid, 4, 9999);
playerVariables[playerid][pWeapons][0] = 34;
playerVariables[playerid][pWeapons][1] = 23;
playerVariables[playerid][pWeapons][2] = 4;
}
}
}
else
{
SCM(playerid, COLOR_TEAL, "You don't have the gun license");
}
return 1;
}
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
new string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME];
new weaponname[24];
GetPlayerName(playerid, attacker, sizeof (attacker));
GetPlayerName(damagedid, victim, sizeof (victim));
GetWeaponName(weaponid, weaponname, sizeof (weaponname));
foreach(Player, z)
{
if(playerVariables[z][pSpectating] == playerid)
{
format(string, sizeof(string), "%s has made %.0f damage to %s, weapon: %s", attacker, amount, victim, weaponname);
SendClientMessage(z,COLOR_RED, string);
}
}
return 1;
}