This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Shield


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 12-30-2011 , 15:08   Shield
Reply With Quote #1

Why doesn't this code work properly? Sometimes it doesn't give all players shield. And sometimes it doesn't give shield to any one.

PHP Code:
public SpartWep( )
{
    new 
players[32], pnum
    
static tempid
    
    get_players
(players,pnum,"ach")
    
    for( new 
ii<pnumi++)
    {
        
tempid players[i];

        if(
cs_get_user_team(tempid) == CS_TEAM_T)
        {
            
strip_user_weapons(tempid)
            
give_item(tempid"weapon_knife")
            
give_item(tempid"weapon_shield")
            
set_pev(tempidpev_viewmodel2"models/shield/v_shield_knife.mdl")
            
set_pev(tempidpev_weaponmodel2"models/shield/p_shield_knife.mdl")
        }
    } 

usaexelent is offline
Send a message via Skype™ to usaexelent
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 12-30-2011 , 18:48   Re: Shield
Reply With Quote #2

When is your function called ?
__________________
You can do anything you set your mind to, man.

Devil259 is offline
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 12-31-2011 , 08:48   Re: Shield
Reply With Quote #3

When menu item is selected.

DayStart("Spartos diena",1)
SpartWep( )
Prasidejo = true
CanDoSparta = 4
SpartaDay = true
usaexelent is offline
Send a message via Skype™ to usaexelent
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 12-31-2011 , 08:52   Re: Shield
Reply With Quote #4

Give the shield when the player spawn.
__________________
micapat is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-31-2011 , 09:33   Re: Shield
Reply With Quote #5

strip_user_weapons(id)
give_item(id, "weapon_knife")
give_item(id, "weapon_shield")

This is working fine for me as long as i'm alive when i try the code.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 01-01-2012 , 16:45   Re: Shield
Reply With Quote #6

This problem only happens when there is a lot of players in server.
usaexelent is offline
Send a message via Skype™ to usaexelent
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:03.


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