SA-MP Forums Archive
meds fees +1 rep - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: meds fees +1 rep (/showthread.php?tid=337259)



meds fees +1 rep - sscarface - 25.04.2012

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


Re: meds fees +1 rep - MichaelProPlayer - 25.04.2012

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



Re: meds fees +1 rep - sscarface - 25.04.2012

i want random system not i take mney for medical fees i want random fees


Re: meds fees +1 rep - Pinguinn - 25.04.2012

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


Re: meds fees +1 rep - sscarface - 25.04.2012

thanx


Re: meds fees +1 rep - sscarface - 25.04.2012

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


Re: meds fees +1 rep - Pinguinn - 25.04.2012

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()


Re: meds fees +1 rep - sscarface - 25.04.2012

thanx