AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Spawn C4 on specific coordinates (https://forums.alliedmods.net/showthread.php?t=307543)

GoldNux 05-14-2018 14:20

[HELP] Spawn C4 on specific coordinates
 
I would like to know how to automatically spawn a ticking C4 bomb on round start.
It should be spawned at specific coordinates.

The plan is to change the coordinates depending on what map it is using get_mapname.
So I would also like to know how to get coordinates, I have used the map spawns editor plugin and tried taking coordinates from the .cfg generated by that plugin but it did not work.

Thank you very much.

HamletEagle 05-14-2018 14:28

Re: [HELP] Spawn C4 on specific coordinates
 
Go where you want the c4 to be and retrieve your origin.

GoldNux 05-14-2018 14:37

Re: [HELP] Spawn C4 on specific coordinates
 
Quote:

Originally Posted by HamletEagle (Post 2592181)
Go where you want the c4 to be and retrieve your origin.

Is there a console command to do this or do I have to write a function for it?

edit: found this.

Code:

#include <amxmodx>
#include <fakemeta>

public plugin_init()
    register_clcmd("origin", "Show_Origin")

public Show_Origin(id)
{
    new Float:Origin[3], szOrigin[3][20]
    pev(id, pev_origin, Origin)
   
    float_to_str(Origin[0], szOrigin[0], 19)
    float_to_str(Origin[1], szOrigin[1], 19)
    float_to_str(Origin[2], szOrigin[2], 19)
   
    client_print(id, print_console, "%s %s %s", szOrigin[0], szOrigin[1], szOrigin[2])
}


GoldNux 05-14-2018 15:51

Re: [HELP] Spawn C4 on specific coordinates
 
Quote:

Originally Posted by HamletEagle (Post 2592181)
Go where you want the c4 to be and retrieve your origin.

edit: I missed a "-" its working now.

I used the function above to get my origin in T spawn on de_dust2.
I then successfully spawned a c4 at this location.

I then got my origin while standing in the middle of the bomb site B (on flat ground).
And then tried to spawn a c4 the same way..

It spawned a bomb, somewhere.. But not at this location, what am I doing wrong?

T spawn origin: (working)
origin[0] = -648.065186
origin[1] = -808.345093
origin[2] = 164.031250

B site origin: (not working)
origin[0] = 1360.031250
origin[1] = 2575.968750
origin[2] = 47.417095

CrazY. 05-15-2018 10:35

Re: [HELP] Spawn C4 on specific coordinates
 
I think you need show some code.


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

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