How to use SetPlayerArmedWeapon?
#1

https://sampwiki.blast.hk/wiki/SetPlayerArmedWeapon

The wiki doesnt give enough info to really understand how it works.

I tried SetPlayerArmedWeapon(playerid, 0) and they can still use any other weapon?

Can someone explain what it does, or give a little sample script on how it works?
Reply
#2

It simply puts a weapon into players hands.
Reply
#3

Quote:
Originally Posted by Seif_
This function switches to the weapon if he has it in his slots.
You can use this if you want a player to only hold a certain weapon without scrolling. However you'd have to use a timer to prevent scrolling using this function.
Before in previous versions, we(or at least I) used GivePlayerWeapon by giving him 1 ammo and taking it away right after so I can switch to a certain weapon that I have in my weapon slots.
Excuse my French, but why would you want to make them not able to scroll?
Reply
#4

Quote:
Originally Posted by Seif_
It's something you can script, but to answer your question, maybe you're in a DM server and you fall on a pickup that takes away all your weapons for a certain time except the current one you're holding. Instead of removing them from the player, you'd do this.
Gotcha.
Reply
#5

Quote:
Originally Posted by MadeMan
It simply puts a weapon into players hands.
Even if you don't have the weapon?
Reply
#6

Quote:
Originally Posted by Damn Right M.I.A!
Quote:
Originally Posted by MadeMan
It simply puts a weapon into players hands.
Even if you don't have the weapon?
No, the player has to have that weapon first. It just forces him to use it.
Reply
#7

And GivePlayerWeapon? Is the same thing... Really?
Reply
#8

Quote:
Originally Posted by irinel1996
Посмотреть сообщение
And GivePlayerWeapon? Is the same thing... Really?
GivePlayerWeapon gives the player the weapon

SetPlayerArmedWeapon causes them to be equipped with it. (or anything in the players inventory)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)