When A player kills sombody eles they get a score.
#1

I can do this perfectly fine when they die they loose a point, but how can i make them gain a point when they killl sombody.

code:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + -1);
 KillingSpree[killerid] ++;
 KillingSpree[playerid] = 0;

 if(KillingSpree[killerid] == 3)
 {
        new pname[24];
        new string[256];
        GetPlayerName(killerid,pname,24);
        format(string,sizeof(string), "Watch Out For %s, Hes On A 3 Man Kill Streak.",pname);
        SendClientMessageToAll(COLOR_YELLOW,string);
 }
Reply
#2

pawn Код:
SetPlayerScore(playerid, +1); //Or whatever score you gain
Have never really wanted to try :S
Reply
#3

Quote:
Originally Posted by SampStunta
Посмотреть сообщение
pawn Код:
SetPlayerScore(playerid, +1); //Or whatever score you gain
Have never really wanted to try :S
Errors, errors and more errors.
This will not work for obvious reasons.

@Hayden_Bruin you have it right, just get rid of the negative sign you have.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason) {
    SetPlayerScore(killerid, GetPlayerScore(killerid) + 1); //this or
    SetPlayerScore(playerid, GetPlayerScore(playerid) - 1); //this or
        //SetPlayerScore(thisplayertogan, GetPlayerScore(thescoreoftheplayer) + 1);
    KillingSpree[killerid]++;
    KillingSpree[playerid] = 0;

    if(KillingSpree[killerid] == 3) {
        new pname[24];
        new string[256];
        GetPlayerName(killerid,pname,24);
        format(string,sizeof(string), "Watch Out For %s, Hes On A 3 Man Kill Streak.",pname);
        SendClientMessageToAll(COLOR_YELLOW,string);
    }
    return 1;
}
Add a point/score to the Killer (killerid) and subtract a score/point from the Killed (playerid)
Reply
#4

SetPlayerScore(killerid, GetPlayerScore(playerid)+1);
Reply
#5

Oh yeah, sorry I forgot the GetPlayerScore part, was on my phone so was in a hurry :S
Reply
#6

Quote:
Originally Posted by SkizzoTrick
Посмотреть сообщение
SetPlayerScore(killerid, GetPlayerScore(playerid)+1);
WARNING! WARNING! DOES NOT COMPUTE WILL ROBINSON!

But yeah what you really need is SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)