Hello folks, since I'm tired to Create Happy Kill Minute and finally its Finish. I've tested it quite well and it seems alright to me.
Now for the stuff you have to manage and learn:
Add This on Functions.nut
function loadhappykill()
{
print("Happy One Minute Loaded!");
NewTimer( "killers", 30000, 1);
}
function random(start, finish)
{
local t;
if (start < 0) t = ((rand() % (-start + finish)) + start)
else
{
t = ((rand() % (finish - start)) + start);
}
return t;
}
function kills()
{
killcash <- 0;
}
function killers()
{
ClientMessageToAll( ">Happy one minute started, Kill Anyone and Get Random Cash.",255,255,0);
print("Killing Has Been Started");
NewTimer( "killeds", 60000, 1);
killcash=1;
}
function killeds()
{
if ( killcash == 1)
{
ClientMessageToAll( "Happy Kill Minute is Over",255,255,0);
print("Killing is Over");
killcash=0;
NewTimer( "killers", 120000, 1);
}
}
Add This Stuff to Main.nut
function onScriptLoad()
{
RandomCash <- array( GetMaxPlayers(), 1 );
kills();
loadhappykill();
}
This onPlayerKill Event
function onPlayerKill( killer, player, weapon, bodypart )
{
if ( killcash == 1)
{
local reward = random(4000,400000);
local kill= RandomCash[killer.ID]*reward;
ClientMessageToAll( "> " +killer.Name+ " Has Won The Happy One Minute By Killing " + player.Name + " And Got "+kill+".",255,255,0);
killer.Cash += kill;
killeds();
}
}
Have fun, if you find any issues contact me.
~ Regards,
~ Finch!
Updated Again
i test it on empty script and its doesent giving me money in happy minute
local kill= RandomCash[killer.ID]*reward
Finch you didn't create any array name RandomCash then why used this???
@Hercules maybe that's the problem.... I maybe wrong as I am from mobile and I didn't test the code.
My Bad! First Post Updated!
if ( killcash == 1)
{
Can't you use a better editor like Sublime Text? If no, then use Notepad++ or Atom. I'll prefer Atom.
still not working finch check it on empty script and fix it if you cant delete it
i know the solution but try to fix it yourself
Maybe explain what the hell a Happy Killing Minute is supposed to be
Quote from: Murdock on May 27, 2016, 11:43 PMMaybe explain what the hell a Happy Killing Minute is supposed to be
Snip 1, Line 12:-
ClientMessageToAll( ">Happy one minute started, Kill Anyone and Get Random Cash.",255,255,0);
:P
Kill someone and get cash, just like the system of a normal DM server :D
Well
@KAKAN I use Notepad++ and
@Hercules can you tell us what error is showing?
Quote from: Finch Real on May 28, 2016, 03:49 AMWell @KAKAN I use Notepad++ and @Hercules can you tell us what error is showing?
Can't you test it before releasing?
Test it on a blank script. That script looks so shit that I don't even want to test it :P
First Post Updated
@KAKAN Neither i Post Some Shit for you It for Newbies ( Not for Noobs ) who just Insult Instead of Creating Snippet