Weapon Bug
#1

Hey guys

I trust the most famous bag with a gun in the SAMP-for example, where the player has in his hand combat and the other player or give him buy sawnoff and his combat turns into sawnoff. Is there any one script against it? Thank you
Reply
#2

Actually, that's not a bug.
Here, i make a code if you want to set player armed weapon to player last weapon.
Код:
stock Test_GivePlayerWeapon(playerid, weaponid, ammo) // Hook GivePlayerWeapon function
{
	SetTimerEx("SetPlayerWeapon", 0, false, "dd", playerid, GetPlayerWeapon(playerid)); // Make a timer to set player armed weapon back to last weapon
	return GivePlayerWeapon(playerid, weaponid, ammo);
}
#if defined _ALS_GivePlayerWeapon
	#undef GivePlayerWeapon
#else
	#define _ALS_GivePlayerWeapon
#endif

#define GivePlayerWeapon Test_GivePlayerWeapon

forward SetPlayerWeapon(playerid, weaponid);
public SetPlayerWeapon(playerid, weaponid)
{
	SetPlayerArmedWeapon(playerid, weaponid);
	return 1;
}
Reply
#3

Can you give me a little better explain this to your code
Reply
#4

BUMP
Reply
#5

Help please
Reply
#6

If you're talking of the arms dealer job in the GodFather script, then you're going to have to learn how to script..

It's a simple if statement, checking if the person who is being sold to has a gun, that conflicts (SPAS12/Sawnoff/Shotgun, AK47/Colt, SDPistol/Deagle) and this is SIMPLE coding.


Not to mention, you should have a /accept option, which in there, it should check what gun the person has, and check if they want to take the other gun.
Reply
#7

Be an example?
Reply
#8

You'll need a variable assigned to each player, that tracks if they've been offered a weapon previously to stop others from coming in whilst the person is typing /accept, and offering a SDPistol/Shotgun so they take that instead of what they should've bought.

You'll also want to check what the player has in that slot to check if people are trying to hand out sd/shotty to people that have the higher weapons.

In the accept command you'd have to check if the player who offered is still online and whether or not they have enough materials to make/offer the weapon.


Really though, you are going to need to learn how to script rather than simply editting things to make it look like its yours. After all, it's obvious that you are working with the godfather script, and being that it's VERY old, you'd be best to learn from it only.

And even then, what you'd learn from it, is so outdated, that it'd be better to look at other gamemodes. (Vortex being a decent one that is a lot more updated than GF)



I'm not saying what you're doing is wrong, or bad, but it is a lot of work if you don't know how to script.

Sure, someone may come round, and paste up a solution, but you won't learn anything from that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)