PDA

View Full Version : dubble points



malyczolg
26th February 2013, 17:59
hello i create dubble points why notwork ?

on callback_playerconnect()

if(!isDefined(self.czolgu)) self.czolgu = false;

callback_playerkilled

if(sMeansOfDeath == "MOD_MELEE")
{
attacker.bash++;
attacker.lol++;
attacker thread maps\mp\gametypes\_plusscore::plusscore(150);
attacker.plusscore+=150;
attacker.scoretoshow=150;
attacker huntyaudobriy\_showbash::init();
if(self.czolgu == true)
{
attacker thread maps\mp\gametypes\_plusscore::plusscore(150);
attacker.plusscore+=150;
attacker.scoretoshow=150;
attacker drczolg\dubble::bash();
attacker.lol++;
attacker.lol++;
}

ON SHOP :



if(response == "dubble")
{
if(self.money >= 1750)
{
self.spent+=1750;

self iprintlnbold("^2. ^7Yo^9u ^7Bou^9ght ^7Dub^9ble ^7Poi^9nts");
self.czolgu = true;
}
if(self.money < 1750)
{
self iprintlnbold("^2. ^7Yo^9u ^7d^9o ^7no^9t ^7ha^9ve ^7eno^9ugh ^7mon^9ey ^2`");
}

}

Ni3ls
26th February 2013, 18:18
You didn't learn from the last time...

if(self.czolgu == true)

change self to attacker

malyczolg
26th February 2013, 18:22
change self for all ? callback_playerconnect , shop , playerkilled?

IzNoGoD
26th February 2013, 18:23
if(poster == "malycczolg")
response = "change self to attacker";

Do you even know what you are doing?

same goes for your if(a) followed by if(!a). Use else.

also stop messing around with the variables used by plusscore. You will only cause trouble. (.plusscore and .scoretoshow)

malyczolg
26th February 2013, 18:29
Hah ,,, sorry i lern only :)

EvoloZz
26th February 2013, 18:30
Change the self to attacker only in the callback_playerkilled, unless you include attacker somewhere else

IzNoGoD
26th February 2013, 18:31
Hah ,,, sorry i lern only :)

Well, i did kinda tell you in your other thread too....

Earliboy
26th February 2013, 19:38
If you want to handle the attacker, who killed someone it attacker.XXXX
If you want to handle the dude who died, its self.XXX

Like:


If(attacker != self) //If a player suicide (killed himself and landed here)
{
self.killstreak = 0; //Set the killstreak of the dude who's dead to 0
attacker.killstreak += 1; //Set +1 at the killstreak of the attacker
}

Ni3ls
26th February 2013, 20:04
if(self.czolgu == true)
{
attacker thread maps\mp\gametypes\_plusscore::plusscore(150);
attacker.plusscore+=150;
attacker.scoretoshow=150;
attacker drczolg\dubble::bash();
attacker.lol++;
attacker.lol++;
}

Change self to attacker. It's not that hard to read