AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Simple kicking question (https://forums.alliedmods.net/showthread.php?t=10058)

Damocles 02-07-2005 06:25

Simple kicking question
 
Hey all

Simple problem, dont ask me why it doesnt work :roll:

All i want to do is kick all the players in the server then change the map (to load a different plugins.ini) Ive been testing it and when im playing on the server it doesnt kick me though, it just changes the map

Any ideas ?

Code:
public match_restart() {     new Players[32]     new playerCount, i, uid     // Get all players excluding bots     get_players(Players, playerCount, "c")         // For each player on the server...     for (i = 1; i < playerCount; i++)     {         uid = Players[i]         // Kick the player         server_cmd("kick #%d ^"%s^"", uid, "Sorry, Clan War is about to begin, you were asked to leave!")       }           // Change the Map to something to load the plugins.ini     server_cmd("changelevel %s", DEFAULTMAP)    }

Thanks for any help

Johnny got his gun 02-07-2005 07:17

I think that the "kick" command likely takes "userid", which is not the entity index but another index. Get it with get_user_userid(entityindex).

Also note that first index of an array starts at 0, not at 1 as you have written.

Noobie 02-07-2005 12:48

you could try
Code:
server_cmd("amx_kick %s",uid, "Sorry, Clan War is about to begin, you were asked to leave!")


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

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