AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Bomb Transfer (https://forums.alliedmods.net/showthread.php?t=156283)

Doc-Holiday 05-03-2011 20:43

Bomb Transfer
 
I found
PHP Code:

fm_transfer_user_gun(carrierrecipientCSW_C4

in the Tutorial area posted by ven. However when i use it it just drops it on the floor

any one know if this works still? or a better way maybe

http://forums.alliedmods.net/showthr...highlight=bomb

It's a bool I know just dont get how to use it stock is below

PHP Code:

stock bool:fm_transfer_user_gun(index1index2wid 0, const wname[] = "") {
    new 
ent_class[32]
    if (!
wid && wname[0])
        
copy(ent_class31wname)
    else {
        new 
weapon widclipammo
        
if (!weapon && !(weapon get_user_weapon(index1clipammo)))
            return 
false
        
        get_weaponname
(weaponent_class31)
    }

    new 
ent_weap fm_find_ent_by_owner(-1ent_classindex1)
    if (!
ent_weap)
        return 
false

    engclient_cmd
(index1"drop"ent_class)

    new 
ent_box pev(ent_weappev_owner)
    if (!
ent_box || ent_box == index1)
        return 
false

    set_pev
(ent_boxpev_flagspev(ent_boxpev_flags) | FL_ONGROUND)
    
dllfunc(DLLFunc_Touchent_boxindex2)
    if (
pev(ent_weappev_owner) != index2)
        return 
false

    
return true


EDIT!!!!!! im an idiot.......

i was blocking touch.. HAHAHAHAHAHHAHAHA DONT JUDGE ME!

ConnorMcLeod 05-04-2011 01:41

Re: Bomb Transfer
 
Or just call cs function GiveC4 with orpheu, it will give c4 to next available player ;)

Doc-Holiday 05-06-2011 00:40

Re: Bomb Transfer
 
Quote:

Originally Posted by ConnorMcLeod (Post 1462907)
Or just call cs function GiveC4 with orpheu, it will give c4 to next available player ;)

Just so you know why i use this. Its going to a specific player selected at round start.

I havent run across it yet but should i use Is_Player if i am selecting a player at round start since is_user_alive isnt always true at the time that the event fires?

ConnorMcLeod 05-06-2011 02:05

Re: Bomb Transfer
 
If you use HLTV event as new round detection, then only surviving players are alive.
Players are spawned the same frame, but after this event.
Also, some players may be in Appearence Menu Selection and in that case they won't be respawned.

IsPlayer won't help on this i think because it always returning true on players.

If you can wait untill RoundStart, there you are granted that all players have been respawned.

If you really want to do this at new round, you can hook CHalfLifeMultiplay::RestartRound POST with orpheu.
If you don't want to use orpheu, you can register FM_StartFrame at HLTV event, and when it is triggered unregister it and execute your code (this method is used in invisibility armouries plugin by VEN).


All times are GMT -4. The time now is 04:27.

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