Player doesnt loose money after hitman kill. -
andershh - 17.12.2010
After the hitman furfills the hit, the hitman gets the money, but the player doesnt loose the money. I couldnt figure out how to fix it so I decided to post it here..
Code.
Код:
ConsumingMoney[killerid] = 1;
new killer[MAX_PLAYER_NAME];
GetPlayerName(killerid, killer, sizeof(killer));
GivePlayerMoney(killerid, (PlayerInfo[playerid][pHeadValue] / 2));
format(string,128,"<< Hitman %s has fulfilled the contract on %s and collected $%d >>",killer,name,PlayerInfo[playerid][pHeadValue]);
SendFamilyMessage(8, COLOR_YELLOW, string);
format(string,128,"<< A Hitman has Fullfilled the Contract that was placed on you, You now have lost $%d. >>", (PlayerInfo[playerid][pHeadValue] / 2) );
SendClientMessage(playerid, COLOR_RED, string);
PlayerInfo[playerid][pHeadValue] = 0;
GivePlayerMoney(playerid, -(PlayerInfo[playerid][pHeadValue] / 2));
GotHit[playerid] = 0;
GetChased[playerid] = 999;
GoChase[killerid] = 999;
Re: Player doesnt loose money after hitman kill. -
Scenario - 17.12.2010
I don't know what you are doing with these functions:
pawn Код:
GivePlayerMoney(killerid, (PlayerInfo[playerid][pHeadValue]/2));
GivePlayerMoney(playerid, -(PlayerInfo[playerid][pHeadValue]/2));
I don't believe you need the ( and )'s. Try this:
pawn Код:
GivePlayerMoney(killerid, PlayerInfo[playerid][pHeadValue]/2);
GivePlayerMoney(playerid, -PlayerInfo[playerid][pHeadValue]/2);
Re: Player doesnt loose money after hitman kill. -
andershh - 17.12.2010
Okay, imma try.
Re: Player doesnt loose money after hitman kill. -
andershh - 17.12.2010
Mmh, ended up with errors.
Код:
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(9102) : error 001: expected token: ",", but found ";"
C:\Users\Anders\Desktop\LSLRP\gamemodes\lslrp.pwn(9108) : error 001: expected token: ",", but found ";"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Re: Player doesnt loose money after hitman kill. -
andershh - 17.12.2010
I belive you know how to the hitman contract works..
(If not,
You /contract 1 - 600.000. An hitman accepts the hit, furfills it and earns the money, and the player who gets kill'd looses the amount.)
Thats basicly what im trying to... yea.
Re: Player doesnt loose money after hitman kill. -
Scenario - 17.12.2010
You are also doing it on this line, which may be the source of the error. You may wish to check all of the lines above this code which you do this in.
pawn Код:
format(string,128,"<< A Hitman has Fullfilled the Contract that was placed on you, You now have lost $%d. >>", (PlayerInfo[playerid][pHeadValue] / 2) );
Re: Player doesnt loose money after hitman kill. -
andershh - 18.12.2010
arr,, that didnt help neither..
Re: Player doesnt loose money after hitman kill. -
XePloiT - 18.12.2010
add this ResetPlayerMoney(playerid);
Re: Player doesnt loose money after hitman kill. -
Rachael - 18.12.2010
I think
pawn Код:
PlayerInfo[playerid][pHeadValue] / 2
will be a float value ( not 100% sure but it seems logical )
try
pawn Код:
floatround((PlayerInfo[playerid][pHeadValue] / 2),floatround_round)
Re: Player doesnt loose money after hitman kill. -
andershh - 19.12.2010
Quote:
Originally Posted by XePloiT
add this ResetPlayerMoney(playerid);
|
where`?