Player doesnt loose money after hitman kill.
#1

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;
Reply
#2

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);
Reply
#3

Okay, imma try.
Reply
#4

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.
Reply
#5

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.
Reply
#6

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) );
Reply
#7

arr,, that didnt help neither..
Reply
#8

add this ResetPlayerMoney(playerid);
Reply
#9

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)
Reply
#10

Quote:
Originally Posted by XePloiT
Посмотреть сообщение
add this ResetPlayerMoney(playerid);
where`?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)