AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with godding doors (https://forums.alliedmods.net/showthread.php?t=40346)

wonsae 06-26-2006 10:52

Problem with godding doors
 
Code:
public plugin_init()     {     register_plugin( "GodDoors", "vl", "Wonsae" )     set_task(1.0,"doorhealth")     } public doorhealth(){     new classname[56], door     entity_get_string(door,EV_SZ_classname,classname,55)     door = equali(classname,"func_door") && equali(classname,"func_door_rotating")     if(equali(classname,"func_door") && equali(classname,"func_door_rotating")){         entity_set_float(door,EV_FL_max_health,2000.0)         entity_set_float(door,EV_FL_health,2000.0)         entity_set_float(door,EV_FL_dmg,0.0)         entity_set_float(door,EV_FL_takedamage,0.0)     }     return PLUGIN_HANDLED }

This code doesn't seem to work :\. This is also for TS. the doors keep breaking :(

Des12 06-26-2006 12:22

Re: Problem with godding doors
 
You have some problems...

First:

door = equali(classname,"func_door") && equali(classname,"func_door_rotating")

is going to make door 0, because classname = null/0 right now. Example:

equali(classname,"func_door") is going to be 0
equali(classname,"func_door_rotating") is going to be 0

door = 0 && 0 is going to be 0

So you have two problems: One, take out this line
door = equali(classname,"func_door") && equali(classname,"func_door_rotating")

Two, assign door to be an entity so the classname is not null

Type /ent and get the entid, then add the maxplayers to that in your plugin


All times are GMT -4. The time now is 07:56.

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