Raised This Month: $ Target: $400
 0% 

Get random spawn coordinates


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-23-2015 , 08:42   Get random spawn coordinates
Reply With Quote #1

I'm trying to make a function which will teleport the player to a random spawn location.

PHP Code:
public teleport_to_spawn(id)
{
    new 
Float:origin[3], entity
    entity 
find_ent_by_class(random_num(-110), get_user_team(id) == "info_player_deathmatch" "info_player_start")
    
entity_get_vector(entityEV_VEC_originorigin)
    
set_user_origin(idorigin)

This doesn't work. It teleports the player outside the map.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
 


Thread Tools
Display Modes

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 22:11.


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