SAMP Multiplication
#1

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

Код:
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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)