[HELP]How can create this?
#1

I need a thing when i kill a player.. add +1 at "something" and when that "something" has ... 10 do something else

Example:
Код:
public OnPlayerDeath(playerid, killerid, reason)
}
AddSometing(killerid);

if(Something == 10)
{
\\blah blah blah
}
return 1;
}
Advise thanks


P.S Sorry my bad english i am Romanian
Reply
#2

You mean a killing spree?
try:

at the top:
Код:
new KillingSpree[MAX_PLAYERS];
and next:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
     KillingSpree[killerid] ++; //gives the killer +1 kill
     KillingSpree[playerid] = 0; //resets the spree of the one that died

     if(KillingSpree[killerid] == 3) //if the killer made 3 kills, then...
     {
          SendClientMessageToAll(color, "OMG, thats a killing spree of 3");//sends a message, use your imagination
     }
}
good luck, this should work
Reply
#3

Quote:
Originally Posted by me-borno
Посмотреть сообщение
You mean a killing spree?
try:

at the top:
Код:
new KillingSpree[MAX_PLAYERS];
and next:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
     KillingSpree[killerid] ++; //gives the killer +1 kill
     KillingSpree[playerid] = 0; //resets the spree of the one that died

     if(KillingSpree[killerid] == 3) //if the killer made 3 kills, then...
     {
          SendClientMessageToAll(color, "OMG, thats a killing spree of 3");//sends a message, use your imagination
     }
}
good luck, this should work
o mean a Team Score ....
Reply
#4

pawn Код:
#include <a_samp>

#define COLOR_WHITE 0xFFFFFFAA

public OnPlayerConnect(playerid)
{
    SetPVarInt(playerid,"Kills",0);
    SetPVarInt(playerid,"Deaths",0);
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    SetPVarInt(playerid,"Kills",0);
    SetPVarInt(playerid,"Deaths",0);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SetPVarInt(playerid,"Deaths",GetPVarInt(playerid,"Deaths")+1);
    SetPVarInt(killerid,"Kills",GetPVarInt(killerid,"Kills")+1);
    if(GetPVarInt(killerid,"Kills") == 10)
    {
        GivePlayerMoney(killerid, 10000);
        SendClientMessage(killerid,COLOR_WHITE,"You've been awarded $10,000 for getting 10 kills!");
    }
    return 1;
}
Like this or?
Reply
#5

Quote:
Originally Posted by Shadow™
Посмотреть сообщение
pawn Код:
#include <a_samp>

#define COLOR_WHITE 0xFFFFFFAA

public OnPlayerConnect(playerid)
{
    SetPVarInt(playerid,"Kills",0);
    SetPVarInt(playerid,"Deaths",0);
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    SetPVarInt(playerid,"Kills",0);
    SetPVarInt(playerid,"Deaths",0);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SetPVarInt(playerid,"Deaths",GetPVarInt(playerid,"Deaths")+1);
    SetPVarInt(killerid,"Kills",GetPVarInt(killerid,"Kills")+1);
    if(GetPVarInt(killerid,"Kills") == 10)
    {
        GivePlayerMoney(killerid, 10000);
        SendClientMessage(killerid,COLOR_WHITE,"You've been awarded $10,000 for getting 10 kills!");
    }
    return 1;
}
Like this or?
I Want a Team Score
Reply
#6

Like gta4 tdm? When i get home ill post a script
Reply
#7

Quote:
Originally Posted by Lolrofl
Посмотреть сообщение
Like gta4 tdm? When i get home ill post a script
sorry i don't have or play gta4 tdm
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)