Raised This Month: $51 Target: $400
 12% 

[HELP] Spawn C4 on specific coordinates


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GoldNux
Senior Member
Join Date: Mar 2018
Old 05-14-2018 , 14:20   [HELP] Spawn C4 on specific coordinates
Reply With Quote #1

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.
__________________
Try my version of de_dust2, I think it's great and you should check it out!
https://gamebanana.com/mods/83731

Last edited by GoldNux; 05-14-2018 at 14:21.
GoldNux is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-14-2018 , 14:28   Re: [HELP] Spawn C4 on specific coordinates
Reply With Quote #2

Go where you want the c4 to be and retrieve your origin.
__________________
HamletEagle is offline
GoldNux
Senior Member
Join Date: Mar 2018
Old 05-14-2018 , 14:37   Re: [HELP] Spawn C4 on specific coordinates
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
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])
}
__________________
Try my version of de_dust2, I think it's great and you should check it out!
https://gamebanana.com/mods/83731

Last edited by GoldNux; 05-14-2018 at 14:46.
GoldNux is offline
GoldNux
Senior Member
Join Date: Mar 2018
Old 05-14-2018 , 15:51   Re: [HELP] Spawn C4 on specific coordinates
Reply With Quote #4

Quote:
Originally Posted by HamletEagle View Post
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
__________________
Try my version of de_dust2, I think it's great and you should check it out!
https://gamebanana.com/mods/83731

Last edited by GoldNux; 05-14-2018 at 16:03.
GoldNux is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-15-2018 , 10:35   Re: [HELP] Spawn C4 on specific coordinates
Reply With Quote #5

I think you need show some code.
__________________








CrazY. is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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