meds fees +1 rep
#1

i want medical fees system and if player die random money paid for meds fees can u help me i need this give me code medical fees system
Reply
#2

Add this at top of your script
Код:
#define COLOR_YELLOW 0xFFFF00AA
Add this under public OnPlayerDeath(playerid, killerid, reason)
Код:
SetPlayerMoney(playerid,); //Type the amount you want to take money for medical fees
SendClentMessage(playerid,COLOR_YELLOW," Your message"); //type your message
Reply
#3

i want random system not i take mney for medical fees i want random fees
Reply
#4

For random fees, you have to use "random()"
Edit MED_MIN_FEE for the minimum value, edit MED_MAX_FEE for the maximum value

On top of your script
pawn Код:
#define MED_MIN_FEE 100
#define MED_MAX_FEE 200
Add this under OnPlayerDeath
pawn Код:
SetPlayerMoney(playerid, (GetPlayerMoney(playerid) - random(MED_MAX_FEE)+MED_MIN_FEE));
SendClientMessage(playerid, 0xFF0000, "You have paid for your medical fees");
Note: I am not sure if random(MED_MAX_FEE)+MED_MIN_FEE) works how it is supposed to be. If someone knows how to fix (if it doesn't function how it is supposed to be), please fix it
Reply
#5

thanx
Reply
#6

and can make this type : "The hospital has charged you $%d for their medical services."
Reply
#7

Replace the OnPlayerDeath part with:

pawn Код:
new localString[128], randomFee = (GetPlayerMoney(playerid) - random(MED_MAX_FEE)+MED_MIN_FEE);
SetPlayerMoney(playerid, randomFee);
format(localString, sizeof(localString), "You have paid $%d for your medical fees", randomFee);
SendClientMessage(playerid, 0xFF0000, localString);
Edit: Forgot to add SendClientMessage()
Reply
#8

thanx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)