AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   TS 2.1 - Dropping gun, Deleting it, Giving Another (https://forums.alliedmods.net/showthread.php?t=57433)

mysticssjgoku4 07-04-2007 15:25

TS 2.1 - Dropping gun, Deleting it, Giving Another
 
Shouldn't this work?....cuz it doesn't :S
Code:
public player_replace_weapon(id,gunid,ammo,clips,extras) {     client_cmd(id,"weapon_%i;wait;drop",gunid)         new Float:origin[3]     pev(id,pev_origin,origin)     new ent = 0, Float:radius = 64.0, classname[32]     while((ent = find_ent_in_sphere(ent,origin,radius)) != 0)     {         pev(ent,pev_classname,classname,31)         client_print(id,print_chat,"Class: %s",classname)         if(equali(classname,"weapon_tsgun"))         {             remove_entity(ent)         }     }     ts_giveweapon(id,gunid,clips,extras)     //ts_set_weapon_ammo(id,gunid,ammo)     return PLUGIN_HANDLED }

Doesn't give me a new gun, Drop the Old gun, and Doesn't delete it.... :-\...

Any ideas anyone?

Thanks :)

Greenberet 07-04-2007 15:28

Re: TS 2.1 - Dropping gun, Deleting it, Giving Another
 
well i havn't coded much in ts yet but shouldnt it be weapon_%s and gunid an string?

mysticssjgoku4 07-04-2007 15:29

Re: TS 2.1 - Dropping gun, Deleting it, Giving Another
 
Oh, it drops the gun, and the id should be an integer for these functions anyhow... lol.
Doesn't give the new gun or deletes it...

And now...it crashes my server..


All times are GMT -4. The time now is 21:33.

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