[SOLVED] Takes too much money on death -
Sydcul - 01.01.2013
Hello,
To start off with, happy 2013 everyone!
I have a TDM gamemode. I made it so that when you get killed, you lose money. But it seems to take my set amount and another $100, no matter what my set amount is. It's very strange. I don't get any warnings or errors whatever when compiling, it just takes too much money. It might also be interesting to know that it takes the correct amount of money when you are in the death screen when you fade out of the dead character, but it takes the $100 when you spawn.
Not sure where i made a fault, just posted the whole GM, only 400 lines (without carspawns)
http://pastebin.com/svgMae79.
Any help would REALLY be appreciated, i like the people here on the forum, but i'm not so good at SA-MP scripting myself so that's why i don't contribute.
SOLVED: It seems that GTA removes the $100 as a hospital/cop bribe, so i don't have to, i'll just add $100 in case of a teamkill.
-Sydcul
Re: Takes too much money on death -
aslan890 - 01.01.2013
Hi bro how much did you set the money? + How much much money does it give?
Check lines: CTFL + F and type this
GivePlayerMoney
Код:
{
if(killerid == INVALID_PLAYER_ID) {
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
GivePlayerMoney(playerid, -100);
SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
} else if(gTeam[killerid] == gTeam[playerid]) {
SetPlayerScore(killerid,GetPlayerScore(killerid)-2);
GivePlayerMoney(killerid, -50);
SendDeathMessage(killerid,playerid,reason);
} else {
GivePlayerMoney(playerid, -100);
SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
SendDeathMessage(killerid,playerid,reason);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
GivePlayerMoney(killerid, 100);
}
return 1;
}
Re: Takes too much money on death -
Sydcul - 01.01.2013
Quote:
Originally Posted by aslan890
Hi bro how much did you set the money? + How much much money does it give?
Код:
{
if(killerid == INVALID_PLAYER_ID) {
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
GivePlayerMoney(playerid, -100);
SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
} else if(gTeam[killerid] == gTeam[playerid]) {
SetPlayerScore(killerid,GetPlayerScore(killerid)-2);
GivePlayerMoney(killerid, -50);
SendDeathMessage(killerid,playerid,reason);
} else {
GivePlayerMoney(playerid, -100);
SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
SendDeathMessage(killerid,playerid,reason);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
GivePlayerMoney(killerid, 100);
}
return 1;
}
|
SUICIDE: -1 score, -$100
TEAMKILL: -2 killer score, -$50 killer
NORMAL KILL: -1 victim score, -$100 victim, +1 killer score, +$100 killer
It's very easy to obtain from the code, tho.
EDIT:
Quote:
Check lines: CTFL + F and type this GivePlayerMoney
|
Well, the shops and the OnPlayerDeath. But why don't you look at it?
Re: Takes too much money on death -
Sydcul - 01.01.2013
Quote:
Originally Posted by ******
The extra 100 is removed by GTA on every death for police bribe/hospital costs.
|
Thanks. Then i guess i don't have to remove the $100 on death, i better give them back in case of a teamkill.
Off-Topic: I really like y_ini, nice!