Raised This Month: $ Target: $400
 0% 

First round knife only & set money 0..


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Healyrae
New Member
Join Date: Dec 2006
Old 01-02-2007 , 12:53   First round knife only & set money 0..
Reply With Quote #1

Hi,

Ive been trying to modify some scripts ive found to do the following on my server.

1st round - Knives only ( Set players money to 0 to prevent buying )
2nd round - Pistols ( Set player money to 800 as a normal 1st round )
3rd round - Normal play

On restartround

Do the same as above.

Ive modded some code by iG_os that I found in these forums and added some code from a money give script. I know the set money 0 code is not in the script.

The problem i'm getting is on a new map the first player joins and the knife script kicks in, but when another player joins the server classes this as restart, the plugin then does a knife round but does not reset money at the end of this round.

This is not what I want because players are keeping the kill money from the knife round and beginning what I want to be a pistol round with MP5s and the like.

If anyone could help me sort this I would be very grateful!!!

Code:
 
#include <amxmodx> 
#include <amxmisc> 
#include <cstrike> 
#define PLUGIN  "FirstRoundKnife" 
#define VERSION "0.1" 
#define AUTHOR  "iG_os" 
 
new bool:FirstRound = true 
new bool:SecondRound = false 
new players[32], playerCount, i, player, pMoney; 
 
public switchweapon(id) 
{ 
   if (FirstRound) 
   { 
      engclient_cmd(id,"weapon_knife") 
   } 
   return PLUGIN_CONTINUE 
} 
 
public newround(id) 
{ 
   if (SecondRound) 
   { 
   pMoney = 800 
   get_players(players,playerCount); 
 
   for(i=0;i<playerCount;i++) 
      { 
         player = players[i]; 
         { 
         cs_set_user_money(player, pMoney); 
         } 
      } 
   SecondRound = false 
   } 
   if (FirstRound) 
   { 
      set_task(3.0, "Mode_msg", id) 
      SecondRound = true 
   } 
   return PLUGIN_CONTINUE 
} 
 
public restartround(){ 
   FirstRound = true 
   return PLUGIN_CONTINUE 
} 
 
public end_round() 
{ 
   FirstRound = false 
   return PLUGIN_CONTINUE 
} 
 
public Mode_msg(id) 
{ 
   new msg[64] 
   format(msg,63,"Knife Round!") 
   set_hudmessage(50, 255, 50, -1.0, 0.70, 0, 6.0, 10.0, 0.5, 0.15, -1) 
   show_hudmessage(id,msg) 
} 
 
public plugin_init(){ 
   register_plugin(PLUGIN,VERSION,AUTHOR) 
   register_event("ResetHUD", "newround", "be") 
   register_event("TextMsg", "restartround", "a", "2&#Game_C", "2&#Game_w") 
   register_event("SendAudio", "end_round", "a", "2&%!MRAD_terwin", "2&%!MRAD_ctwin", "2&%!MRAD_rounddraw") 
   register_event("CurWeapon", "switchweapon", "be", "1=1","2!29") 
}

Last edited by Healyrae; 01-03-2007 at 14:00.
Healyrae is offline
 



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 22:19.


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