UpdateText & Spree & Rank System

Started by FinchDon, Sep 06, 2015, 06:22 AM

Previous topic - Next topic

jayant

@FinchDon - Look the spree system and just remove one  local reward = GetPlayerSpree(player) * 500; since both the lines are the same then I think there will no occur in console/server.


KAKAN

I think it'll double the reward
oh no

FinchDon

For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

KAKAN

NOW TELL ME WHAT'S THE NEED OF UpdateTextAll
oh no

FinchDon

updatetextall is use for everyplayer in server not one
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

KAKAN

What's the need? You don't use any timers to update it.
If you are doing like that, then use a foreach loop to update current players
oh no

KAKAN

*Sorry for BUMP*
btw,
Can we do the Criminal rank system using switch-case, I think we can't
oh no

MacTavish

#22
Yes you can its easy to do if you know it

Code removed..
.
Actually i could be implemented with case but it will create a huge code i would suggest you to do not use cases

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

KAKAN

I can do it that way the problem was:-
He used some symbols like <=, I was in doubt, and are u sure the function you made will work?
oh no

FinchDon

Me?? If Yes My Code will work 100% Then it your choice to set kills where and where and rank names
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

KAKAN

This(Getrank) system can be done with a easy and better way tho, here is a example code
function GetRank( player )
{
local kill = stats[ player.ID ].Kills,a;
if(kill<=100) return "Newbie";
else if(kill<=200) return "Adventurer";
else if(kill<=300) return "Dangerous";
else if(kill<=350) return "Fighter";
else if(kill<=400) return "Street Thug";
else if(kill<460) return "Legolas";
else if(kill<=560) return "Hustler";
else if(kill<=650) return "Bully";
else if(kill<=1000) return "Outlaw";
else if(kill<=1400) return "Assassin";
else if(kill<=1900) return "Murderous";
else if(kill<=2500) return "Psychotic";
else if(kill<=3550) return "Boss";
else if(kill<=5000) return "Don";
else if(kill<=10000) return "Godfather";
else if(kill<=20000) return "Hax0r";
}

Its tested.
[mergedate]1442670710[/mergedate]
The IncCash function u gave is wrong, its like set money because you used '=' instead of '+=', hope you understood
Here is the correct code, update it.
function IncCash( player, amount )
{
      local cash = player.Cash
   local add = cash + amount;
   player.Cash += add;
}
And yes, use player.Cash, not everyone has the same array as u have
oh no

KAKAN

This one is good, add this
function onPlayerJoin( player )
{
Ranks <- CreateTextdraw("Your Rank: " + GetRank( player ),41,480,0x99990000 );
Ranks.ShowForPlayer( player );
}

Its kinda useful!
oh no

FinchDon

Will You Please Stop Bumping? I release full tested Snippet
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

KAKAN

I was just trying to improve it with less lines
oh no

Thijn

Quote from: KAKAN on Sep 19, 2015, 01:55 PMThe IncCash function u gave is wrong, its like set money because you used '=' instead of '+=', hope you understood
Here is the correct code, update it.
function IncCash( player, amount )
{
      local cash = player.Cash
   local add = cash + amount;
   player.Cash += add;
}
And yes, use player.Cash, not everyone has the same array as u have
That code is wrong as well, since it will increase the cash twice.