Raised This Month: $ Target: $400
 0% 

Solved Coins Plugin - Only Current Player Problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
polimpo4
Member
Join Date: Jan 2017
Old 04-18-2018 , 23:53   Coins Plugin - Only Current Player Problem
Reply With Quote #1

I Create One Plugin To Give Coins To Players..

Like:

1 Normal Kill = 1 Coin
1 Knife Kill = 2 Coins
1 HeadShot = 3 Coins

The Problem:

When Another Player Kill Enemy Even From Other Team The Plugin Give Coins To All... I Need To Know How To Restric Only To The Current Player Give Himself Coins Not From Others...


The Code:

PHP Code:
/ * Plugin generated by AMXX-Studio * /

#include <amxmodx>
#include <amxmisc>
#include <cstrike>


#define PLUGIN "hudsync loop"
#define VERSION "3.2"
#define AUTHOR "_ | Polimpo4 | _"



// Variables
new Points 0;

public 
plugin_init () {
register_plugin (PLUGINVERSIONAUTHOR)

register_event ("DeathMsg""ev_DeathMsg""a");

set_task (0.5"Loop2"0""0"b");
}

public 
client_putinserver (id) {
set_task (0.5"Loop2"0""0"b");
}


public 
ev_DeathMsg () {
// new Live = is_user_alive (id)
new Attacker read_data (1)
new 
Vitima read_data (2)
new 
Headshot read_data (3)
new 
Arma get_user_weapon (Attacker// we can determine it by doing this
// new weapon [32]
// read_data (4, weapon, sizeof (weapon) -1) // but it is not important which method you will use.
new Virus_Name [32// this is just a variable, you can call whatever you want.
get_user_name (VictimVictimName31)
new 
Nickname [32]
get_user_name (AttackerAttackerName31)


if (
Gun == CSW_KNIFE) {
Points Points 2;
set_task (0.5"showpoints (Attacker)")
client_print (Attackerprint_chat"You killed% s with a knife"victim_name)
client_print (Victimprint_chat"You were killed by% s for a knife"Name_Actuating)
}

if (
Headshot) {

Points Points 3;
set_task (0.5"showpoints (Attacker)")
// Show to the attacker who killed.

client_print (Attackerprint_chat"You killed% s by HS"victim_name)

} else if (
Headshot) {

// Show to the victim who killed him:

client_print (Vitimaprint_chat"You were killed by the% s by HS"Name_Actuating)

}

else {
// this is the normal kill

Points Points 1;
set_task (0.5"showpoints (Attacker)")
// Show to the attacker who killed.

client_print (Attackerprint_chat"You killed% s"victim_name)

// Show to the victim who killed him:

client_print (victimprint_chat"was dead by% s"target_name)

}

if (
Attacker == Victim) {
client_print (Attackerprint_chat"You committed suicide!")
return 
PLUGIN_CONTINUE
}
****
if (
cs_get_user_team (Forward) == cs_get_user_team (Victim)) {
return 
PLUGIN_CONTINUE
}

if (
Attacker! = victim) {
// if he has killed 3 this round execute a function

}
****
return 
PLUGIN_CONTINUE
****
}

public 
mostrapontos (Forward) {
****
// your code here
****
****
client_print (Strikerprint_chat"One More Point!")
****
set_task (0.1"Loop2")
}


public 
Loop2 (id, & Points) {

set_hudmessage (2552552550.040.7000.02.00.00.2false)

show_hudmessage (id"Coins:% i"Points);


I Know I Have To Make CVARS But It Is Only In Dev Version.

Anyone Can Help Me?

Last edited by polimpo4; 04-19-2018 at 19:24. Reason: up
polimpo4 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 04:44.


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