SAMP Multiplication - 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: SAMP Multiplication (
/showthread.php?tid=366550)
SAMP Multiplication -
Shockey HD - 06.08.2012
I am looking into a Killstreak System in which your money earning will increase + 1000 Every kill. So the most effective way for high killstreak i would do this.
Код:
if(pInfo[playerid][pStreak] >= 18)
{
format(string,sizeof(string),"%s is on a killstreak of %i!",pName(killerid),pInfo[killerid][pStreak]);
SendClientMessageToAll(COLOR_GREEN,string);
}
Now i wish for an example, If you killstreak is 18 that it will be multiplied by 1000.
Would i do it like this?
Код:
new Money = pInfo[playerid][pStreak];
new WinPoint = Money*1000;
GivePlayerMoney(playerid,WinPoint);
Re: SAMP Multiplication -
Christopher - 06.08.2012
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(pInfo[killerid][pStreak] >= 18)
{
format(string,sizeof(string),"%s is on a killstreak of %i!",pName(killerid),pInfo[killerid][pStreak]);
SendClientMessageToAll(COLOR_GREEN,string);
GivePlayerMoney(killerid, GetPlayerMoney(killerid) * 1000);
}
else
{
format(string,sizeof(string),"%s is on a killstreak of %i!",pName(killerid),pInfo[killerid][pStreak]);
SendClientMessageToAll(COLOR_GREEN,string);
GivePlayerMoney(killerid, GetPlayerMoney(killerid) + 1000);
}
That section of code would mean if the killer had the pStreak multidimentional value of 18+ there amount of cash would be CURRENT AMOUNT * 1000 and if they had the pStreak of < 18 then it would be CURRENT AMOUNT + 1000. I think that's what you wanted anyway?