Damage and exp - 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)
+--- Thread: Damage and exp (
/showthread.php?tid=491226)
Damage and exp -
xZdadyZx - 29.01.2014
so I want to get damage did on player on playertakdamage and to give killerid amount of exp how many damage points he did, on player. help?
Re: Damage and exp -
Excelize - 30.01.2014
Uh... W-what?..
Please make this possible to read, then people will help you.
Re: Damage and exp -
xZdadyZx - 30.01.2014
Quote:
Originally Posted by Excelize
Uh... W-what?..
Please make this possible to read, then people will help you.
|
I was tired while writing that. So what I want is : When killerid damage other player, it qill give him ( to killerid ) expirience.But how many damage he do on player, thats amount of expirience that he will be given. If you still do not understand me... If I damage you im game for 46 DMG points, then I will get same amount of expirience needed for level.
Re: Damage and exp -
Threshold - 30.01.2014
If you are using 0.3z:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && issuerid != playerid)
{
PlayerInfo[issuerid][Experience] += amount; //This is an example, you may have something other than PlayerInfo[issuerid][Experience] to define your experience level.
//NOTE: The person HITTING the player is 'issuerid', not 'playerid'.
}
return 1;
}
Versions earlier than 0.3z:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID && issuerid != playerid)
{
PlayerInfo[issuerid][Experience] += amount; //This is an example, you may have something other than PlayerInfo[issuerid][Experience] to define your experience level.
//NOTE: The person HITTING the player is 'issuerid', not 'playerid'.
}
return 1;
}
Re: Damage and exp -
xZdadyZx - 30.01.2014
Quote:
Originally Posted by BenzoAMG
If you are using 0.3z:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart) { if(issuerid != INVALID_PLAYER_ID && issuerid != playerid) { PlayerInfo[issuerid][Experience] += amount; //This is an example, you may have something other than PlayerInfo[issuerid][Experience] to define your experience level. //NOTE: The person HITTING the player is 'issuerid', not 'playerid'. } return 1; }
Versions earlier than 0.3z:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid) { if(issuerid != INVALID_PLAYER_ID && issuerid != playerid) { PlayerInfo[issuerid][Experience] += amount; //This is an example, you may have something other than PlayerInfo[issuerid][Experience] to define your experience level. //NOTE: The person HITTING the player is 'issuerid', not 'playerid'. } return 1; }
|
+reputation Thank you so much!