AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Constant Check? (https://forums.alliedmods.net/showthread.php?t=24353)

Dizzy 02-19-2006 21:05

Constant Check?
 
How would you make there be a constant check for something??

Like I don't want CT's to have shields sooo

I would

Code:
register_event("??????")

Not sure what event to do...

I can get the rest done though...

Jordan 02-19-2006 21:12

Code:
register_event("CurWeapon" , "noshields" , "be");

I think that's the event you want.

Dizzy 02-19-2006 21:39

Alright, now I get error 035: argument type mismatch (argument 1)

on line 25

Code:
#pragma tabsize 0 #include <amxmodx> #include <cstrike> public plugin_init() {     register_plugin("Drop Shields","0.1","Dizzy")     register_cvar("amx_dropshields","1")     register_event("CurWeapon","shield","be") } public shield(id) {     if(get_cvar_num("amx_dropshields")!=1)     {         return PLUGIN_HANDLED     }     if(cs_get_user_team(id) == CS_TEAM_T)     {         return PLUGIN_HANDLED     }       new weaponname[33]     get_user_weapons(weaponname, 32)     if(cs_get_user_team(id) == CS_TEAM_CT && containi(weaponname, "shield") > -1)     {         client_cmd(id,"drop weapon_shield")         return PLUGIN_HANDLED     }     return PLUGIN_HANDLED }

v3x 02-19-2006 22:02

Code:
// [...]     new CsTeams:team = cs_get_user_team(id);     if(team == CS_TEAM_CT && cs_get_user_shield(id))     {         engclient_cmd(id,"weapon_shield","drop") // I think?         return PLUGIN_CONTINUE     } // [...]
Btw, there's no need to check if he's on the Terrorist team so you can get rid of this:
Code:
    if(cs_get_user_team(id) == CS_TEAM_T)     {         return PLUGIN_HANDLED     }

GHW_Chronic 02-19-2006 22:03

yeah, if a CT drops the shield and a T comes walking by spawn...

v3x 02-19-2006 22:04

He never said that he did not want terrorists to have shields.

If you don't want either teams to have shields, restrict it!

GHW_Chronic 02-19-2006 22:20

A. didnt see CT on main post
B. didnt see && team==CS_TEAM_CT
C. Yo.

Shinzon 02-20-2006 00:16

Code:
#include <amxmodx> public check_shield(id) { if (get_cvar_num("sv_noshield")!=1) return PLUGIN_CONTINUE    new llama = read_data(0)           client_print(llama,print_center,"Shield dropped. Not allowed!")       client_cmd(llama,"weapon_shield;wait;wait;wait;drop")       return PLUGIN_CONTINUE } public plugin_init(){    register_plugin("Drop Shield","0.01","originally for AWP by SuicideDog")    register_event("WeapPickup","check_shield","b","1=xy")    register_cvar("sv_noshield","1")    return PLUGIN_CONTINUE }

ATTENTION!!

U have to replace:

register_event("WeapPickup","check_shield","b ","1=xy")

with the id for shield, which i dont know at time.

GHW_Chronic 02-20-2006 00:18

or do it as v3x said...

Shinzon 02-20-2006 00:32

Quote:

Originally Posted by v3x
If you don't want either teams to have shields, restrict it!

Hey...that's the easy way.... :wink: :wink:


All times are GMT -4. The time now is 20:25.

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