Kill Streaks
#1

Well I have all my kill streaks done except for the 30 kills streak. The problem is.. I want the dude who has 30 kill streak to have the ability to do /nuke (EVEN IF HE DIES). Keep in mind that /nuke has to kill EVERYONE online. But I'm just a beginner at scripting, so how the fuck could I do that? Here's the part of my script with the kill streaks.

Код:
	if(Spree[killerid] == 20)
	{
	GivePlayerMoney(killerid, 1000);
	}
	if(Spree[killerid] == 21)
	{
	GivePlayerMoney(killerid, 1000);
	SetPlayerHealth(killerid, 100);
	SetPlayerArmor(killerid, 100);
	SendClientMessage(killerid, "You have been awarded with full Health and Armor for you kill streak of 21!");
	}
	if(Spree[killerid] == 22)
	{
	GivePlayerMoney(killerid, 1000);
	}
	if(Spree[killerid] == 23)
	{
	GivePlayerMoney(killerid, 1000);
	}
	if(Spree[killerid] == 24)
	{
	GivePlayerMoney(killerid, 1000);
	}
	if(Spree[killerid] == 25)
	{
	GivePlayerMoney(killerid, 1000);
	}
	if(Spree[killerid] == 26)
	{
	GivePlayerMoney(killerid, 1000);
	GivePlayerWeapon(killerid, 38, 1000);
	SendClientMessage(killerid, "You have been awarded with a 1000 bullet Minigun for your kill streak of 26!");
	}
	if(Spree[killerid] == 27)
	{
	GivePlayerMoney(killerid, 1000);
	}
	if(Spree[killerid] == 28)
	{
	GivePlayerMoney(killerid, 1000);
	}
	if(Spree[killerid] == 29)
	{
	GivePlayerMoney(killerid, 1000);
	}
	if(Spree[killerid] == 30)
	{
	GivePlayerMoney(killerid, 1000);
	//WHAT DO I DO HERE?!?!?!?!
	}
Reply
#2

pawn Код:
new HasNuke[MAX_PLAYERS];
    if(Spree[killerid] == 20)
    {
    GivePlayerMoney(killerid, 1000);
    }
    if(Spree[killerid] == 21)
    {
    GivePlayerMoney(killerid, 1000);
    SetPlayerHealth(killerid, 100);
    SetPlayerArmor(killerid, 100);
    SendClientMessage(killerid, "You have been awarded with full Health and Armor for you kill streak of 21!");
    }
    if(Spree[killerid] == 22)
    {
    GivePlayerMoney(killerid, 1000);
    }
    if(Spree[killerid] == 23)
    {
    GivePlayerMoney(killerid, 1000);
    }
    if(Spree[killerid] == 24)
    {
    GivePlayerMoney(killerid, 1000);
    }
    if(Spree[killerid] == 25)
    {
    GivePlayerMoney(killerid, 1000);
    }
    if(Spree[killerid] == 26)
    {
    GivePlayerMoney(killerid, 1000);
    GivePlayerWeapon(killerid, 38, 1000);
    SendClientMessage(killerid, "You have been awarded with a 1000 bullet Minigun for your kill streak of 26!");
    }
    if(Spree[killerid] == 27)
    {
    GivePlayerMoney(killerid, 1000);
    }
    if(Spree[killerid] == 28)
    {
    GivePlayerMoney(killerid, 1000);
    }
    if(Spree[killerid] == 29)
    {
    GivePlayerMoney(killerid, 1000);
    }
    if(Spree[killerid] == 30)
    {
    GivePlayerMoney(killerid, 1000);
    HasNuke[killerid] = 1;
    }

COMMAND:nuke(playerid, params[])
{
   if(HasNuke[playerid] != 1) return SendClientMessage(playerid, COLOR_RED, "You don't have the nuke streak yet!");
   foreach(Player, i) // creates a loop for everyone.
   {
     if(i != playerid) // checks everyone except you, so nuke wont kill yourself.
     {
       SetPlayerHealth(i 0.0); // sets everyones health to 0 which makes them die.
       SendClientMessage(i, COLOR_RED, "You died due a nuke!"); // send a message to everyone.
     }
   }
    HasNuke[playerid] = 0; // sets it to 0 if he/she used the nuke.
   return 1;
}
Reply
#3

Don't I have to do something under the COMMAND:nuke(playerid...?
Reply
#4

Quote:
Originally Posted by ZaaRawwR
Посмотреть сообщение
Don't I have to do something under the COMMAND:nuke(playerid...?
Added

EDIT: oops I used playerid instead of killerid, copy my code now.
Reply
#5

What do you mean by "// here nuke shit?"
Reply
#6

Quote:
Originally Posted by ZaaRawwR
Посмотреть сообщение
What do you mean by "// here nuke shit?"
That's where you put your Nuke code.
Reply
#7

Quote:
Originally Posted by ZaaRawwR
Посмотреть сообщение
What do you mean by "// here nuke shit?"
Well I supposed you could do the loop by yourself, but anyways I've done it for you. Check the code now.
Reply
#8

And by the way, I get these errors:

Код:
C:\Users\Kevin\Desktop\Servers\One in the Chamber\filterscripts\killingspree.pwn(4) : error 017: undefined symbol "MAX_PLAYERS"
C:\Users\Kevin\Desktop\Servers\One in the Chamber\filterscripts\killingspree.pwn(194) : warning 203: symbol is never used: "HasNuke"
Reply
#9

Quote:
Originally Posted by ZaaRawwR
Посмотреть сообщение
And by the way, I get these errors:

Код:
C:\Users\Kevin\Desktop\Servers\One in the Chamber\filterscripts\killingspree.pwn(4) : error 017: undefined symbol "MAX_PLAYERS"
C:\Users\Kevin\Desktop\Servers\One in the Chamber\filterscripts\killingspree.pwn(194) : warning 203: symbol is never used: "HasNuke"
You either don't have defined MAX_PLAYERS, which should be from the start...either you have a different definition!

Show us where you put the code.
Reply
#10

This is where my defines and shiz and new HasNuke are..
Код:
 #include <a_samp>
#define MAX_PLAYERS
#define COLOR_YELLOW 0xFFFF00AA
#if defined FILTERSCRIPT
new HasNuke[MAX_PLAYERS];
This is the error I get
Код:
 C:\Users\Kevin\Desktop\Servers\One in the Chamber\filterscripts\killingspree.pwn(5) : warning 201: redefinition of constant/macro (symbol "MAX_PLAYERS")
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)