AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Sticking to eachother (https://forums.alliedmods.net/showthread.php?t=24434)

wonsae 02-22-2006 17:25

Sticking to eachother
 
How would I make someone like say /stick then the guy is like stuck onto the other player and the player controls the guy who says /stick

Hawk552 02-22-2006 17:32

what

wonsae 02-22-2006 17:38

Like when someone says /stick near a person and a menu shows up says this person wants to stick on you do you accept yes or no. if yes the person sticks onto the other person

Hawk552 02-22-2006 17:40

I don't think I've ever heard of a more retarded idea.

You mean you're literally glued to the person? What's the point of that?

Xanimos 02-22-2006 17:43

Human shield?

Hawk552 02-22-2006 17:44

That makes a bit of sense, but you can already do that with the grab plugin.

Xanimos 02-22-2006 17:45

yes you can.

GHW_Chronic 02-22-2006 18:01

Here. hook what the clcmd to the said_stick function and add some extra parameters here in there to round it out.

Code:
new offset[3][33] new stuckto[33] public client_PreThink(id) {     new origin[3]     get_user_origin(stuckto[id],origin)     origin[0] += offset[0][id]     origin[1] += offset[1][id]     origin[2] += offset[2][id]     set_user_origin(stuckto[id],origin) } public said_stick(id) {     new Float:origin[3]     entity_get_vector(id,EV_VEC_origin,origin)     new ent = find_ent_in_spere(id,origin,34.0)     if(!ent)     {         client_print no ent         return PLUGIN_HANDLED     }     stuckto[ent]=id     new origin2[3]     get_user_origin(ent,origin2)     offset[0][ent] = origin2[0] - floatround(origin[0])     offset[1][ent] = origin2[1] - floatround(origin[1])     offset[2][ent] = origin2[2] - floatround(origin[2])     return PLUGIN_HANDLED }

wonsae 02-22-2006 19:51

Thank you

wonsae 02-23-2006 21:59

I tried this and it didn't work can anyone help me?

Code:

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>


#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"


public plugin_init() {
        register_plugin(PLUGIN, VERSION, AUTHOR)
        register_clcmd("/rope","rope")
}

new offset[3][33]
new stuckto[33]

public client_PreThink(id)
{
    new origin[3]
    get_user_origin(stuckto[id],origin)
    origin[0] += offset[0][id]
    origin[1] += offset[1][id]
    origin[2] += offset[2][id]
    set_user_origin(stuckto[id],origin)
}

public rope(id)
{
    new Float:origin[3]
    entity_get_vector(id,EV_VEC_origin,origin)
    new ent = find_ent_in_sphere(id,origin,34.0)
    if(!ent)

    stuckto[ent]=id
    new origin2[3]
    get_user_origin(ent,origin2)
    offset[0][ent] = origin2[0] - floatround(origin[0])
    offset[1][ent] = origin2[1] - floatround(origin[1])
    offset[2][ent] = origin2[2] - floatround(origin[2])
    return PLUGIN_HANDLED
}



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

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