Raised This Month: $ Target: $400
 0% 

Solved Problem with a code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BraveFox
AlliedModders Donor
Join Date: May 2015
Location: Israel
Old 10-03-2016 , 12:52   Problem with a code
Reply With Quote #1

PHP Code:
public Action Event_PlayerDeath(Event event, const char[] namebool dontBroadcast)
{
    
int attacker GetClientOfUserId(GetEventInt(event"attacker"));
    if(
decoyround == true)
    {
        
GivePlayerItem(attacker"weapon_decoy");
    }

I have this^^ code and I want to do that when player is killing someone it gives him decoy, it's work when I kill him with knife or weapon I gets a decoy but when I kill someone with a decoy it's not giving me another decoy.
Pls help.
Ty
__________________
Contact Me:
Steam: NoyB
Discord: Noy#9999
Taking Private Requests

Last edited by asherkin; 10-25-2018 at 17:18. Reason: Restore to previous version.
BraveFox is offline
BraveFox
AlliedModders Donor
Join Date: May 2015
Location: Israel
Old 10-03-2016 , 13:42   Re: Problem with a code
Reply With Quote #2

Problem Solved it fixed IDK why it did problems..
__________________
Contact Me:
Steam: NoyB
Discord: Noy#9999
Taking Private Requests
BraveFox is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 10-03-2016 , 14:47   Re: Problem with a code
Reply With Quote #3

PHP Code:
if(decoyround == true
Boolean variable can have a value other than "true" and "false"?
Why not just?
PHP Code:
if(decoyround
Maybe better at first was be defined whether we need to receive in general values of an event, and then to request them if they are required?
PHP Code:
public Action Event_PlayerDeath(Event event, const char[] namebool dontBroadcast
{
    if(
decoyround
    { 
        
int attacker GetClientOfUserId(GetEventInt(event"attacker")); 
        if(
attacker <= MaxClient && IsClientInGame(attacker) && IsClientAlive(attacker)) GivePlayerItem(attacker"weapon_decoy"); 
    } 

Or just are missing in the text of a large piece of code?
Quote:
Errors
Invalid entity index or no mod support.
Link
__________________

Last edited by Grey83; 10-03-2016 at 15:01.
Grey83 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 04:26.


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