25.09.2012, 17:01
pawn Код:
CMD:createpackage(playerid, params[])
{
if(PlayerInfo[playerid][pJob] !=2)
return 0;
new
wep[128],
ammo
;
if(sscanf(params,"s[128]i",wep,ammo))
return SendClientMessage(playerid,C_NICE,"[Usage] {FFFFFF}/createpackage [weapon] [ammo]");
/*if(!IsPlayerInRangeOfPoint(playerid,3.0,0,0,0))
return 0;*/
if(ammo > 20)
return SendClientMessage(playerid,C_RED,"Maximum ammo in package: 2000 (x*100)");
if(equal(wep,"deagle",true))
{
if(AC_GetPlayerMoney(playerid) < DEAGLE_100*ammo) return SendClientMessage(playerid,C_RED,"You don't have enough money.");
ForLoop(i,12)
{
if(PlayerInfo[playerid][pWPack][i] == 0)
{
PlayerInfo[playerid][pWPack][i] = DEAGLE;
PlayerInfo[playerid][pWPackA][i] = ammo*100;
}
}
}
if(equal(wep,"mp5",true))
{
if(AC_GetPlayerMoney(playerid) < DEAGLE_100*ammo) return SendClientMessage(playerid,C_RED,"You don't have enough money.");
ForLoop(i,12)
{
if(PlayerInfo[playerid][pWPack][i] == 0)
{
PlayerInfo[playerid][pWPack][i] = MP5;
PlayerInfo[playerid][pWPackA][i] = ammo*100;
SendFormat(playerid,C_NICE,"[Packages] {FFFFFF}You have bought %i magazines of 100 bullets [Package Slot: %i, Weapon: %s]",ammo,i,wep);
}
}
}
return 1;
}