Raised This Month: $ Target: $400
 0% 

Scripting Help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Mortdredd
Senior Member
Join Date: Dec 2009
Old 02-02-2010 , 05:52   Re: Scripting Help
Reply With Quote #16

Quote:
Originally Posted by M249-M4A1 View Post
I completely missed this part before:

Code:
public Action:g_tmrGiveAmmo_TimerTick(Handle:timer) {     new intPlayerIndex = 1;
    {        &nb sp;// if the client is set to have unlimited ammo, give it to them        &nb sp;if( g_enuPlayerAmmo[intPlayerIndex] == enuPlayerAmmoType_Unlimited )        &nb sp;GiveFullAmmo(intPlayerIndex);
    } }



it seems that you are defining the player index to give ammo to as index 1, so player index 1 will ALWAYS get full ammo. you might not be player index 1 in the game so you should do a loop through all players, setting their indicies to unlimited ammo, rather than hardcoding just 1. give that a try.

id also recommend doing a PrintToAllChat("timer running") message in each of the functions (with different text), so that you can see if its even being called or not

the originalcontained this bit of code

//********************************************* *************************************
//* Name: Initialize Player List
//* Abstract: set all the players to have normal ammo management
//********************************************* *************************************
public InitializePlayerList()
{
new intPlayerIndex = 0;

//go through each player spot and set them to normal ammo type (they get nothing special)
for (intPlayerIndex = 1; intPlayerIndex <= MAXPLAYERS; intPlayerIndex += 1)
{
g_enuPlayerAmmo[intPlayerIndex] = enuPlayerAmmoType_Normal;
}

}
would that do what you are talking about?
Mortdredd 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 09:36.


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