Spree not working..
#1

Guys i add this but spree is not working.. Please help me

pawn Код:
if(GetPlayerScore(killerid) == 5)
    {
        SetPlayerScore(killerid, GetPlayerScore(killerid)+2);
        GivePlayerMoney(killerid, 1000);
       
        new string[64], pName[MAX_PLAYER_NAME];
        GetPlayerName(killerid,pName,MAX_PLAYER_NAME);
        format(string,sizeof string,"Server News: %s is Now On Killing Spree Of 5 ",pName);
        SendClientMessageToAll(0xFF8000FF,string);
        SendClientMessage(killerid,COLOR_GREEN,"Congratulation! You Got +2 Scores and 1000$ Money For Killing 5 in Row!");
        return 1;
    }
Reply
#2

You're doing something completely...irrelevant; if the player's score is '5', he's on a killing spree? So what if he relogs and his score will be 120 for example, will he have a spree of '121' on the next kill then? Better write a new one or check out my tutorial (in my signature)...
Reply
#3

can u add this??. I want simple like mine. plz....
Reply
#4

Put it on OnPlayerDeath and for KilledID instead of playerid
Reply
#5

Try this.

pawn Код:
if(GetPlayerScore(killerid) == 5)
    {
        SetPlayerScore(killerid, GetPlayerScore(killerid)+2);
        GivePlayerMoney(killerid, 1000);
       
        new string[64], pName[MAX_PLAYER_NAME];
        GetPlayerName(killerid ,pName, sizeof(pName));
        format(string, sizeof(string),"Server News: %s is Now On Killing Spree Of 5 ",pName);
        SendClientMessageToAll(0xFF8000FF, string);
        SendClientMessage(killerid, COLOR_GREEN,"Congratulations! You got +2 score and 1000$ money for killing 5 in a row!");
        return 1;
    }
Reply
#6

Lol this is a fail KillingSpree... Try under OnPlayerUpdate and check players score and then check if it's increased with 5 kills and he haven't died... << this is how you can do it try looking for a tutorial maybe.
Reply
#7

work with a variable

pawn Код:
new s[MAX_PLAYERS];
//
public OnPlayerDeath(playerid, killerid, reason) {
    s[playerid] = 0;
    s[killerid] ++;
    if(s[killerid] == 5) {
        SetPlayerScore(killerid, GetPlayerScore(killerid)+2);
        GivePlayerMoney(killerid, 1000);
        new string[64], pName[MAX_PLAYER_NAME];
        GetPlayerName(killerid,pName,MAX_PLAYER_NAME);
        format(string,sizeof string,"Server News: %s is Now On Killing Spree Of 5 ",pName);
        SendClientMessageToAll(0xFF8000FF,string);
        SendClientMessage(killerid,COLOR_GREEN,"Congratulation! You Got +2 Scores and 1000$ Money For Killing 5 in Row!");
        s[killerid] = 0;
    }
    return true;
}
Reply
#8

@!zbt. it is giving these errors...

pawn Код:
D:\Game\SA-MP Files\SF Wars\gamemodes\Wars.pwn(716) : error 029: invalid expression, assumed zero
D:\Game\SA-MP Files\SF Wars\gamemodes\Wars.pwn(716) : error 001: expected token: ";", but found "{"
D:\Game\SA-MP Files\SF Wars\gamemodes\Wars.pwn(732) : warning 225: unreachable code
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#9

You are not adapting properly
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) {
    s[playerid] = 0;
    s[killerid] ++;
    if(s[killerid] == 5) {
        SetPlayerScore(killerid, GetPlayerScore(killerid)+2);
        GivePlayerMoney(killerid, 1000);
        new string[64], pName[MAX_PLAYER_NAME];
        GetPlayerName(killerid,pName,MAX_PLAYER_NAME);
        format(string,sizeof string,"Server News: %s is Now On Killing Spree Of 5 ",pName);
        SendClientMessageToAll(0xFF8000FF,string);
        SendClientMessage(killerid,COLOR_GREEN,"Congratulation! You Got +2 Scores and 1000$ Money For Killing 5 in Row!");
        s[killerid] = 0;
    }
    //other functions
Reply
#10

Thnx bro. thank you soo much. Its is working great........... (rep added all of u as gift )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)