![]() |
Ok new p[roblem il lcontinue on this thread..... how do you set the players weapon with a script so that the player wuldnt do it manually, i.e a hotkey script?
|
Quote:
|
setplayerprop#w doesnt work i have tried that that was my first attempt i tried both clientsided and serversided
|
Quote:
You could do a check of the client's inventory and use addweapon, since the newest weapon is always the one that is selected first. I don't know if this is secure or not though. |
Split to another thread, please refer to the rules.
As for your question, use a for loop to go through the player's weapon IDs, then check if the #w (weaponname) of that ID is the one you want. Hint: #w can take a param in the form of a weapon's ID. Quote:
|
wait what exactly do u mean a for loops? I dont know how it uld set it though pleas ebe a little more clear and sorry i started what shuld have been a diff thread
|
Quote:
NPC Code: Read up on for loops to get a good understanding of what each of these parts is, but I will give you another hint for after you have done so: You will want to loop through until the weaponscount. That'll be part of your your test condition. |
Perhaps it is nice to know to do selectedweapon = i too.
|
Quote:
|
um i know how for loops worked i mean how wuold that help u select a wepon theres no command that i know of that will actually set your wepon even if u find the right one!
|
Quote:
|
ok Let me see if i can get this straight. Your saying I should do smething lilke this for selecting the weapon
NPC Code: AM I right? Well I will try it. |
Looks right.
|
It works now i just have to fix it up so it works with two ro three word wepon names since it works by a chat command and tokenizing but i can figure that out i think
|
Use #e....
|
Quote:
Also: NPC Code:for (i=o;i<weaponscount;i++) You have 'o' there not '0' (zero). This works, because the variable 'o' has not been set to anything, so it is zero. But if you need to use the var 'o' once, you shouldn't have it in the for loop... This will not be a problem if you don't set 'o' or you can just use zero there. |
oh oops and how would i use #e? do u do like #e(6,-3,#c) or soemthing? For now i have it so it tells you to just put quotes around it since that makes it 1 word
|
| All times are GMT +2. The time now is 10:49 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.