Quick Switch
#1

Is there a way to make a system that you can't quickswap your weapon, i mean something that if you shoot with a gun, you cant change the weapon before 3 seconds after you stop shooting?
Reply
#2

You can't block weapon changing, but you can use SetPlayerArmedWeapon in timer or OnPlayerUpdate. Save player weapon and time in variables.

Код:
new theWeapon[MAX_PLAYERS], theTime[MAX_PLAYERS];

public OnPlayerWeaponShot(...)
{
	theWeapon[playerid] = weaponid;
	theTime[playerid] = gettime() + 3;
	return 1;
}

public OnPlayerUpdate(playerid)
{
	if(theTime[playerid] >= gettime())
	{
		SetPlayerArmedWeapon(playerid, theWeapon[playerid]);
	}
	return 1;
}
Something like this.
Reply
#3

Not work
Reply
#4

Show full code, I gave only example which mustn't work.
Reply
#5

Tested it and works fine!
Reply
#6

I want make something which will detect is player fast switch weapon,and if is yes server say him you cant this very fast,please wait some second and try again
Reply
#7

Quote:
Originally Posted by bigboy81
Посмотреть сообщение
I want make something which will detect is player fast switch weapon,and if is yes server say him you cant this very fast,please wait some second and try again
Freeze him , send him a message, unfreeze him with a timer
Reply
#8

I won't give you full working code, sorry - here is help how to start, rest thing you have to do on your own. If you want full code look for scripter for money.
Reply
#9

ball don't help me please, i don't need help from people who don't want show me the full code.
leave out
Reply
#10

@Bigboy: Ball is right, we are not here to give you full working scripts, if that's what you want, you have to go to the request-topic where you can find people who are willing to script for money.

This forum section is just for help. It's you who needs to learn how to script and you won't learn anything if we hand you complete scripts. You have to do it yourself and if you have any questions or trouble with something, you can ask it here and we are here to help you.

That's how you learn to script.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)