Raised This Month: $ Target: $400
 0% 

Simple kicking question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Damocles
Member
Join Date: Jan 2005
Old 02-07-2005 , 06:25   Simple kicking question
Reply With Quote #1

Hey all

Simple problem, dont ask me why it doesnt work

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
Damocles is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 02-07-2005 , 07:17  
Reply With Quote #2

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.
Johnny got his gun is offline
Noobie
Junior Member
Join Date: Oct 2004
Location: uk
Old 02-07-2005 , 12:48  
Reply With Quote #3

you could try
Code:
server_cmd("amx_kick %s",uid, "Sorry, Clan War is about to begin, you were asked to leave!")
Noobie is offline
Send a message via ICQ to Noobie Send a message via AIM to Noobie Send a message via MSN to Noobie
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 19:17.


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