Raised This Month: $ Target: $400
 0% 

New round events + some other things


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-13-2007 , 15:32   Re: New round events + some other things
Reply With Quote #1

With your code, player_id is always the id of the last player connected to your server (even if this player has left).
Also, return player_id is non sense in client_putinserver function.

Either you use round_start event, and then take Arkshine's code that execute command through all alive players, either you use ResetHUD event.

Look at this code, i hope you will understand

Code:
#include <amxmodx> #define MAX_PLAYERS 32 new bool:g_RestartAttempt[MAX_PLAYERS+1] public plugin_init() {     register_plugin("Base Plugin","0.1","AceDude")         register_event("HLTV", "eNewRound", "a", "1=0", "2=0")     register_logevent("eRoundStart", 2, "1=Round_Start")     register_logevent("eRoundEnd", 2, "1=Round_End")         register_event("TextMsg", "eRestartAttempt", "a", "2=#Game_will_restart_in")     register_event("ResetHUD", "eResetHUD", "be")     register_clcmd("clcmd_fullupdate", "fullupdateCmd") } public fullupdateCmd() {     return PLUGIN_HANDLED_MAIN } public eRestartAttempt() {     new players[32], num     get_players(players, num, "a")     for (new i; i < num; ++i)         g_RestartAttempt[players[i]] = true } public eResetHUD(id) {     if (g_RestartAttempt[id]) {         g_RestartAttempt[id] = false         return     }     event_player_spawn(id) }   public event_player_spawn(id) {     // put here the code you want to execute to player, each time he is spawning     client_print(id, print_chat, "[AMXX] Player Spawn | Your ID is %d", id) } public eNewRound() {     new players[32], inum, player     get_players(players, inum) // i didn't put flag "a" here because dead players haven't spawn yet     for(new i; i<inum; i++)     {         player = players[i]         client_print(player, print_chat, "[AMXX] Freezetime | Your ID is %d", player)     } } public eRoundStart() {     new players[32], inum, player     get_players(players, inum, "a")     for(new i; i<inum; i++)     {         player = players[i]         client_print(player, print_chat, "[AMXX] Round Start | Your ID is %d", player)     } } public eRoundEnd() {     new players[32], inum, player     get_players(players, inum, "a")     for(new i; i<inum; i++)     {         player = players[i]         client_print(player, print_chat, "[AMXX] Round End | Your ID is %d", player)     } }

Last edited by ConnorMcLeod; 10-13-2007 at 15:35.
ConnorMcLeod is offline
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 01:23.


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