29.03.2013, 11:54
(
Последний раз редактировалось SKAzini; 17.04.2013 в 14:30.
)
This code is supposed to check if you already have the weapon you've specified that you want from the locker and then reset that specific weapon, leaving you with your old weapons and a new load of ammo on that weapon you want.
Ex.
You have an MP5 (300 ammo), shotgun (2 ammo) and sdpistol (20 ammo).
You go to the locker and press the Shotgun which will give you 30 ammo.
Your weapons get resetted, you get back all of your weapons except the shotgun. Now, you will get a shotgun with 30 ammo.
However, when I press a weapon in the locker it will reset the weapons and give me only that specific weapon..
[ame]http://www.youtube.com/watch?v=N76qJRQMsas[/ame]
Ex.
You have an MP5 (300 ammo), shotgun (2 ammo) and sdpistol (20 ammo).
You go to the locker and press the Shotgun which will give you 30 ammo.
Your weapons get resetted, you get back all of your weapons except the shotgun. Now, you will get a shotgun with 30 ammo.
However, when I press a weapon in the locker it will reset the weapons and give me only that specific weapon..
pawn Код:
case DIALOG_LOCKER_SFPD2:
{
if(response)
{
new wepid[7], wepsa[13][2];
wepid[0] = 3;
wepid[1] = 41;
wepid[2] = 22;
wepid[3] = 25;
wepid[4] = 29;
wepid[5] = 31;
wepid[6] = 24;
for (new a = 0; a < 13; a++)
{
GetPlayerWeaponData(playerid, a, wepsa[a][0], wepsa[a][1]);
ResetPlayerWeapons(playerid);
if(wepsa[a][0] != wepid[listitem]) GivePlayerWeapon(playerid, wepsa[a][0], wepsa[a][1]);
}
switch(listitem)
{
case 0: GivePlayerWeapon(playerid, 3, 1);
case 1: GivePlayerWeapon(playerid, 41, 2000);
case 2: GivePlayerWeapon(playerid, 22, 100);
case 3: GivePlayerWeapon(playerid, 25, 30);
case 4: GivePlayerWeapon(playerid, 29, 400);
case 5: GivePlayerWeapon(playerid, 31, 250);
case 6: GivePlayerWeapon(playerid, 24, 25);
case 7: SetPlayerHealth(playerid, 100);
case 8: SetPlayerArmour(playerid, 100);
}
}
}