Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Request cash or money or bounty code
#1
Hey i need somebodys help on a ode for me zombie mod. i need a code where when you kill somebody you get money like 50 dollars and then you can buy something in the menu.
can somebody help me out plzBig GrinBig GrinBig Grin
Reply

#2
you can modify _damage file ( callback_playerkilled() ), or waittil("killed_player");
also
Wrong section
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#3
moved to "Modding problems"
Reply

#4
its very simple:
The variable you must define is
PHP Code:
self.money 
or another name (but self. on the beginning)

in _callbacksetup.gsc
PHP Code:
CodeCallback_PlayerKilled(eInflictoreAttackeriDamagesMeansOfDeathsWeaponvDirsHitLoctimeOffsetdeathAnimDuration)
{
    
self endon("disconnect"); 
you can put code like
PHP Code:
eAttacker.money eAttacker.money 50

This is to give the killer of the player 50 "Money".

Hope its all right Wink
Sorry for bad English Blush -> *GERMAN*
Reply

#5
(10-31-2011, 13:19)gumpo03 Wrote: its very simple:
The variable you must define is
PHP Code:
self.money 
or another name (but self. on the beginning)

in _callbacksetup.gsc
PHP Code:
CodeCallback_PlayerKilled(eInflictoreAttackeriDamagesMeansOfDeathsWeaponvDirsHitLoctimeOffsetdeathAnimDuration)
{
    
self endon("disconnect"); 
you can put code like
PHP Code:
eAttacker.money eAttacker.money 50

This is to give the killer of the player 50 "Money".

Hope its all right Wink

actually if you followed the right tutorial: "Modding, The right way" you can do this without modifying any of the existing files just by defining "level.onPlayerKilled" and making a function for it

Code:
init()
{
    level.onPlayerKilled = ::onPlayerKilled;
}

onPlayerKilled( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration )
{
    if( isDefined( eAttacker ) && isPlayer( eAttacker ) && eAttacker != self )
        eAttacker.money += 50;
}
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#6
but he didn't , because he followed the beginners tutorial Troll
fail itsmods is fail
Reply

#7
(11-01-2011, 00:23)iAegle Wrote:
(10-31-2011, 13:19)gumpo03 Wrote: its very simple:
The variable you must define is
PHP Code:
self.money 
or another name (but self. on the beginning)

in _callbacksetup.gsc
CodeCallback_PlayerKilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration)
{
self endon("disconnect");[/php]
you can put code like
PHP Code:
eAttacker.money eAttacker.money 50

This is to give the killer of the player 50 "Money".

Hope its all right Wink

actually if you followed the right tutorial: "Modding, The right way" you can do this without modifying any of the existing files just by defining "level.onPlayerKilled" and making a function for it

Code:
init()
{
    level.onPlayerKilled = ::onPlayerKilled;
}

onPlayerKilled( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration )
{
    if( isDefined( eAttacker ) && isPlayer( eAttacker ) && eAttacker != self )
        eAttacker.money += 50;
}

ok so like in init i would put
PHP Code:
level.onPlayerKilled = ::onPlayerKilled
and i can make a new thread called Cash or something and put something like
Code:
OnPlayerKilled()
{
    if( isDefined( player ) && isPlayer() && player != self )
        eAttacker.money += 50;
}
[/quote]
like something like that??
ok so i got a code and it works for the texts and stuff
heres code this was in point system thread:
Code:
Cash()
{
     self.money_text destroy();
     self.money_num destroy();
     //Money text
     self.money_text = newClientHudElem(self);
     self.money_text.alignX = "left";
     self.money_text.alignY = "bottom";
     self.money_text.horzAlign = "left";
     self.money_text.vertAlign = "bottom";
     self.money_text.alpha = 1;
     self.money_text.x = 5;
     self.money_text.y = -100;
     self.money_text.fontscale = 1.4;
     self.money_text.color = (0,0.6,0);
     self.money_text setText("$ ");
     //Money number
     self.money_num = newClientHudElem(self);
     self.money_num.alignX = "left";
     self.money_num.alignY = "bottom";
     self.money_num.horzAlign = "left";
     self.money_num.vertAlign = "bottom";
     self.money_num.x = 52;
     self.money_num.y = -100;
     self.money_num.alpha = 1;
     self.money_num.fontscale = 1.4;
     self.money_num.color = (0,0.6,0);
     self.money_num setValue(self.bounty);
}
PHP Code:
self.bounty 
This works but i need a code where when you kill someone you will get money without adding _callback(something).gsc i just need the cach thing to be in the _rank not anything else PleaseBig Grin

would this work
Code:
MonitorBounty()
{
    self endon("death");
    
    for(;;)
    {
        self waittill("human_kill");
        self.money += 50;
        wait .1;
    }
}
HuhHuhHuh

Reply

#8
ok so i did
Code:
MonitorBounty()
{
     self endon("death");
    
     for(;;)
     {
         self waittill("human_kill");
         self.money += 50;
         wait .1;
     }
}
and
PHP Code:
self waittill("kill"); 
but those didnt work and i tried
PHP Code:
eAttack.money eAttack.money 
PHP Code:
eAttack.money +=50 
and didnt work either so what can i do to make them ADD $50 dollars to my money when i kill someone
Reply

#9
self waittill("player_killed");
[Image: lQDUjba.jpg]
Reply

#10
You don't have to make 2 hud elements just to show "$" and "value" .. you can just do

self.money_num = newClientHudElem(self);
self.money_num.alignX = "left";
self.money_num.alignY = "bottom";
self.money_num.horzAlign = "left";
self.money_num.vertAlign = "bottom";
self.money_num.x = 52;
self.money_num.y = -100;
self.money_num.alpha = 1;
self.money_num.fontscale = 1.4;
self.money_num.color = (0,0.6,0);
self.money_num.label = "$";
self.money_num setValue(self.bounty);
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Code color crosshairs koren30 3 4,013 10-02-2013, 19:26
Last Post: koren30
  Help need help?how to make plugins code hXnarutoXone 12 8,532 09-01-2013, 18:30
Last Post: Bandarigoda123
  Help Need Help with C# code tubwux 2 3,308 08-27-2013, 18:18
Last Post: tubwux
  [Request] Compile this code please dozsa0 4 4,123 08-10-2013, 21:02
Last Post: Nukem
  Compile this code please First_Semyon 12 9,661 08-08-2013, 14:53
Last Post: Bandarigoda123
  Compile please this code First_Semyon 8 5,627 07-28-2013, 01:52
Last Post: First_Semyon
  Code of vector Bloodfocus 1 2,405 06-23-2013, 11:54
Last Post: Yamato
  problem with gsc code CheGuevara 5 5,604 04-20-2013, 15:06
Last Post: Nekochan
Tongue [Request] read if you have a cs:go code:) rawr-saours 5 4,052 04-05-2013, 18:15
Last Post: SuperNovaAO
Smile Help Help me with a code (who knows) NyZzE 2 2,534 04-05-2013, 01:47
Last Post: NyZzE

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.