Get score, armour and health after kill.
#1

Does anyone know how to make script that gives you score, armour and health after i kill other player? it would be cool in DM server
Reply
#2

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new score;
    score = GetPlayerScore(killerscore);
    SetPlayerScore(killerid, score+10); //change 10 to whatever you like
    new armour;
    armour = GetPlayerArmour(playerid);
    SetPlayerArmour(killerid, armour+10);
    SetPlayerHealth(killerid, 100);
    return 1;
}
Reply
#3

Quote:
Originally Posted by Sandiel
Посмотреть сообщение
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new score;
    score = GetPlayerScore(killerscore);
    SetPlayerScore(killerid, score+10); //change 10 to whatever you like
    new armour;
    armour = GetPlayerArmour(playerid);
    SetPlayerArmour(killerid, armour+10);
    SetPlayerHealth(killerid, 100);
    return 1;
}
Код:
C:\Users\Windows7\Desktop\Test\gamemodes\test.pwn(117) : error 017: undefined symbol "killerscore"
C:\Users\Windows7\Desktop\Test\gamemodes\test.pwn(120) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new score;
    score = GetPlayerScore(killerid);
    SetPlayerScore(killerid, score+10); //change 10 to whatever you like
    new armour;
    armour = GetPlayerArmour(playerid);
    SetPlayerArmour(killerid, armour+10);
    SetPlayerHealth(killerid, 100);
    return 1;
}
Reply
#5

Quote:
Originally Posted by [MP]Ditch
Посмотреть сообщение
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new score;
    score = GetPlayerScore(killerid);
    SetPlayerScore(killerid, score+10); //change 10 to whatever you like
    new armour;
    armour = GetPlayerArmour(playerid);
    SetPlayerArmour(killerid, armour+10);
    SetPlayerHealth(killerid, 100);
    return 1;
}
Код:
C:\Users\Windows7\Desktop\Test\gamemodes\test.pwn(120) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Damn
Reply
#6

Quote:
Originally Posted by Subwoofer
Посмотреть сообщение
Код:
C:\Users\Windows7\Desktop\Test\gamemodes\test.pwn(117) : error 017: undefined symbol "killerscore"
C:\Users\Windows7\Desktop\Test\gamemodes\test.pwn(120) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Oh my bad, I wasn't paying attention to that, sorry
Change it to
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new score;
    score = GetPlayerScore(killerid);
    SetPlayerScore(killerid, score+10); //change 10 to whatever you like
    new Float:killerarmour;
    GetPlayerArmour(killerid, killerarmour);
    SetPlayerArmour(killerid, killerarmour+10);
    new Float:killerHP;
    GetPlayerHealth(killerid, killerHP);
    SetPlayerHealth(killerid, killerHP+10);
    return 1;
}
Reply
#7

Quote:
Originally Posted by Sandiel
Посмотреть сообщение
Oh my bad, I wasn't paying attention to that, sorry
Change it to
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new score;
    score = GetPlayerScore(killerid);
    SetPlayerScore(killerid, score+10); //change 10 to whatever you like
    new Float:killerarmour;
    GetPlayerArmour(killerid, killerarmour);
    SetPlayerArmour(killerid, killerarmour+10);
    new Float:killerHP;
    GetPlayerHealth(killerid, killerHP);
    SetPlayerHealth(killerid, killerHP+10);
    return 1;
}
LOL, shit happens . BTW it works, i guess. I dont have any tester with my in game right now but still, thanks and Rep+.
Reply
#8

Quote:
Originally Posted by Subwoofer
Посмотреть сообщение
LOL, shit happens . BTW it works, i guess. I dont have any tester with my in game right now but still, thanks and Rep+.
No problem, PM me anytime.


NOTE: there is no reason for it NOT to work, it's real simple basic functions put together
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)