First kill system buged
#1

So when i test first kill system i release that its have a big problems, first of all its give exp for both persons who made it first like Player1 killed Player2 they get both exp bat only Player1 should get exp. Ant other bug its doesn't matter if he killed his self like explode he still get exp for first kill like its doesn't detect if someone killing him. Sorry for me bad sentence.
Her me code
Код:
    if(killcounter == 1)
    {
	new fbname[MAX_PLAYER_NAME], fbstring[128];
	GetPlayerName(killerid, fbname, sizeof(fbname));
	format(fbstring, sizeof(fbstring),""chat""COL_WHITE" %s "COL_GREEN"has made first kill and achieve "COL_WHITE"25EXP", fbname);
    SendClientMessageToAll(0xAFAFAFAA, fbstring);
	GameTextForAll(fbstring, 2000, 3);
	GivePlayerXP(playerid,25);
Reply
#2

Seriously... You're using killerid for the message, then give XP to the player who died...
Reply
#3

Look at this


pawn Код:
new serverKills;
new pKills[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID) { //making sure we have a valid killer. ie: player killed a player
        pKills[killerid] += 1; //adding 1 more kill to the killer
        if(serverKills == 0) { //if there were no kills yet
            GivePlayerXP(killerid,25); //giving XP to the killer
           
            new string[128];
            format(string,sizeof(string),"%s first blood!",GetName(killerid));
            SendClientMessageToAll(COLOR_GREEN,string);
        }
        serverKills += 1; //we are adding 1 more server kill to total kills
    }
    return 1;
}
Reply
#4

Thanks fixed
Reply
#5

Quote:
Originally Posted by TwinkiDaBoss
Посмотреть сообщение
Look at this


pawn Код:
new serverKills;
new pKills[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID) { //making sure we have a valid killer. ie: player killed a player
        pKills[killerid] += 1; //adding 1 more kill to the killer
        if(serverKills == 0) { //if there were no kills yet
            GivePlayerXP(killerid,25); //giving XP to the killer
           
            new string[128];
            format(string,sizeof(string),"%s first blood!",GetName(killerid));
            SendClientMessageToAll(COLOR_GREEN,string);
        }
        serverKills += 1; //we are adding 1 more server kill to total kills
    }
    return 1;
}
Stop handing out copy-paste code, and undermining direct learning...
Reply
#6

Quote:
Originally Posted by TwinkiDaBoss
Посмотреть сообщение
Look at this


pawn Код:
new serverKills;
new pKills[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID) { //making sure we have a valid killer. ie: player killed a player
        pKills[killerid] += 1; //adding 1 more kill to the killer
        if(serverKills == 0) { //if there were no kills yet
            GivePlayerXP(killerid,25); //giving XP to the killer
           
            new string[128];
            format(string,sizeof(string),"%s first blood!",GetName(killerid));
            SendClientMessageToAll(COLOR_GREEN,string);
        }
        serverKills += 1; //we are adding 1 more server kill to total kills
    }
    return 1;
}
Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Seriously... You're using killerid for the message, then give XP to the player who died...
Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Stop handing out copy-paste code, and undermining direct learning...
I didn't copy everything i just edit me script with this system and i saw whats wrong.
Reply
#7

That's the thing, did you even read what I had put, which was straight forward...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)