AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need help with a few things (https://forums.alliedmods.net/showthread.php?t=47748)

Martin1 11-25-2006 13:24

Need help with a few things
 
1. i am trying to make a turn based mod and there are some thtings i cannot figure out.

1. How can i make it so sv_maxspeed is 0 (so noone can move) but through the menu force them to move.
2. How would i make them move in any base, because cmd_client(+forward will not work because its a + command.

Answer me and free cookies

The Specialist 11-25-2006 13:33

Re: Need help with a few things
 
here this will make all players freeze on spawn. then use the same set_user_maxspeed i did to unfrezze whoever. :wink:
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #define MAX_PLAYERS            32 new bool:g_restart_attempt[MAX_PLAYERS + 1] public plugin_init() {     register_plugin("whatever","0.1","The Speicialist");     register_event("ResetHUD", "event_hud_reset", "be")     register_clcmd("fullupdate", "clcmd_fullupdate")     register_event("TextMsg", "event_restart_attempt", "a", "2=#Game_will_restart_in") } public clcmd_fullupdate() {     return PLUGIN_HANDLED } public event_restart_attempt() {     new players[32], num     get_players(players, num, "a")     for (new i; i < num; ++i)     {         g_restart_attempt[players[i]] = true     } } public event_hud_reset(id) {     if (g_restart_attempt[id])     {         g_restart_attempt[id] = false         return     }     event_player_spawn(id) } public event_player_spawn(id) {     set_user_maxspeed(id,1.0); }
:wink:

Emp` 11-25-2006 14:25

Re: Need help with a few things
 
setting maxspeed to 0.0 does not make the player stopped (it makes them keep the same speed or something, but it doesn't stop them) so you can just set it to 1.0

then to have them move by a menu, you could have the menu set their velocities and they will just move with the velocity and have no control over it. :wink:

The Specialist 11-25-2006 14:47

Re: Need help with a few things
 
:wink: fixed my originol code and set max speed to 1.0 like EMP' said :up: its safe to use my code now. thanks EMP


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

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