AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   pfn_touch + bool check = gives error (https://forums.alliedmods.net/showthread.php?t=62918)

Pamaliska 11-07-2007 08:27

pfn_touch + bool check = gives error
 
Hello everybody.
Could anybody tell me how to integrate a chech for my boll (Awp_User) into this code. I did what I could but it gives me an error when compiling.
Cheers.

Quote:

Error: Undefined symbol "id" on line 385


Code:

        if( equal( Weapon_Model, "models/w_awp.mdl" ) && Awp_User[id] = false)

ConnorMcLeod 11-07-2007 08:29

Re: pfn_touch / bool check = gives error
 
Replace 'id' with 'ptd' ?

also add a '=' symbol :

Awp_User[ptd] == false
or
!Awp_User[ptd] (is the same)

Pamaliska 11-07-2007 08:40

Re: pfn_touch + bool check = gives error
 
Works like it should, thank you.
Since I received your help so quickly, I urge to ask for another solution to my problem. Is there any ready-made solution that would allow me to restrict (rather than force drop) users to buy certain weapons, if users do not pass bool check for Awp_User ?
Cheers.

purple_pixie 11-07-2007 09:17

Re: pfn_touch + bool check = gives error
 
Not easily.

You can block them from using it with:

Code:

set_pev(id,pev_weapons,pev(id,pev_weapons)&~(1<<CSW_AWP))
When they acquire a new weapon.

<fakemeta>

Pamaliska 11-07-2007 09:24

Re: pfn_touch + bool check = gives error
 
I've already blocked the usage of awp by implementing bool check; if a player does not pass bool check, he/she drops that wepon and is not able to pick it back. But I don't want them to loose money. That is why I want to block awp buy, if they do not pass my bool check.
Any ideas?

purple_pixie 11-07-2007 09:31

Re: pfn_touch + bool check = gives error
 
That makes more sense.

I would say that if they fail the check you should destroy the weapon and give them the cost.

But then that would happen if they picked one up ...

You might just have to hook all the various buy commands.

Pamaliska 11-07-2007 16:54

Re: pfn_touch + bool check = gives error
 
Quote:

Originally Posted by purple_pixie (Post 550458)

I would say that if they fail the check you should destroy the weapon and give them the cost.

I can not destroy weapon entity, since a player that passed bool check could accidentaly drop that wepon.

Wilson [29th ID] 11-07-2007 17:52

Re: pfn_touch + bool check = gives error
 
You can hook attachtoplayer in hamsandwich and block it.

Pamaliska 11-07-2007 18:18

Re: pfn_touch + bool check = gives error
 
Quote:

Originally Posted by Wilson [29th ID] (Post 550623)
You can hook attachtoplayer in hamsandwich and block it.

Can not find any function description for this module.

Wilson [29th ID] 11-08-2007 09:19

Re: pfn_touch + bool check = gives error
 
Download the newest version of amxx...1.8...it's in includes/ham_const.inc and includes/hamsandwich.inc


All times are GMT -4. The time now is 01:15.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.