AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   teleport a player to a random place (https://forums.alliedmods.net/showthread.php?t=74857)

hzqst 07-26-2008 04:50

teleport a player to a random place
 
i use resethud to detect the player spawn
and use
get_user_origin(id,gspawn[id])
to store where he spawned
Quote:

public zmtele(id){
if(get_user_team(id) == 3 || get_user_team(id) == 0 || !is_user_alive(id))
return PLUGIN_HANDLED;
if(gteletimes[id] <= 0){
client_print(id, print_chat, "%L", id, "ZM_TELE_USEUP")
return PLUGIN_HANDLED;
}
if(gspawn[id][0] == 0 && gspawn[id][1] == 0){
client_print(id, print_chat, "%L", id, "ZM_TELE_ERROR")
return PLUGIN_HANDLED;
}
new x
while(get_user_team(x) != 0 && get_user_team(x) != 3 && is_user_connected(x)){
x = random_num(1,get_maxplayers())
if (get_user_team(x) != 0 && get_user_team(x) != 3 && is_user_connected(x))
set_user_origin(id,gspawn[x])
}
gteletimes[id] --
client_print(id, print_chat, "%L", id, "ZM_TELE",gteletimes[id])
return PLUGIN_HANDLED;
}
but nothing happened


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

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