SA-MP Forums Archive
[HELP]How can create this? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]How can create this? (/showthread.php?tid=163006)



[HELP][UNSOLVED]How can create this? - eDz0r - 25.07.2010

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


Re: [HELP]How can create this? - me-borno - 25.07.2010

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


Re: [HELP]How can create this? - eDz0r - 26.07.2010

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 ....


Re: [HELP]How can create this? - Shadow™ - 26.07.2010

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?


Re: [HELP]How can create this? - eDz0r - 26.07.2010

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


Re: [HELP]How can create this? - WillyP - 26.07.2010

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


Re: [HELP]How can create this? - eDz0r - 26.07.2010

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