05.04.2013, 21:16
(
Последний раз редактировалось RiChArD_A; 22.04.2013 в 11:39.
)
Deleted.
I KNOW WHAT IT IS! I JUST WANT TO EDIT SOME THING IN THE CODE AND I NEED TO KNOW WHERE IS THE PART WHERE THE KILLED PLAYER GETS MONEY!
|
public OnPlayerDeath(playerid, killerid, reason)
{
new playercash; // new variable to store a value
if(killerid == INVALID_PLAYER_ID) // if killerid is not a valid/connected player (ID 65536)
{
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason); // then it sends the icon of falling/explosion
ResetPlayerMoney(playerid); // it sets money to 0
}
else // else killerid is a valid/connected player
{
SendDeathMessage(killerid,playerid,reason); // it sends the death message (icon killer > player with this weapon)
SetPlayerScore(killerid,GetPlayerScore(killerid)+2); // it sets +2 score ( old score + 2 )
playercash = GetPlayerMoney(playerid); // it assignes a value to the first variable with the playerid's money
if (playercash > 100) // if the cash is greater than 100
{
GivePlayerMoney(killerid, playercash); // then it gives the money to the killer
ResetPlayerMoney(playerid); // it sets playerid's money to 0
}
else // if the cash is lower than 100 or equal to 100
{
// do something;
}
}
return 1; // return a value to the callback
}
public OnPlayerDeath(playerid, killerid, reason) //callback when a player dies
{
new playercash; //new variable
if(killerid == INVALID_PLAYER_ID) { //if the killerid is invalid run the code block:
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason); //Sending a death message
ResetPlayerMoney(playerid); //Reset the victim's money
} else { //if the killerid is valid:
SendDeathMessage(killerid,playerid,reason); //Sending a death message
SetPlayerScore(killerid,GetPlayerScore(killerid)+2); //Giving the killer 2 extra score
playercash = GetPlayerMoney(playerid); //Storing the victim's cash into playercash
if (playercash > 100) { //if the victim's cash is above 100:
GivePlayerMoney(killerid, playercash); //Give the killer all of the victim's cash
ResetPlayerMoney(playerid); //Reset the victim's cash
}
else // if the cash is lower than 100 or equal to 100
{
// do something;
}
}
return 1;
}
pawn Код:
|
public OnPlayerDeath(playerid, killerid, reason)
{
new playercash; // new variable to store a value
if(killerid == INVALID_PLAYER_ID) // if killerid is not a valid/connected player (ID 65536)
{
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason); // then it sends the icon of falling/explosion
ResetPlayerMoney(playerid); // it sets money to 0
}
else // else killerid is a valid/connected player
{
SendDeathMessage(killerid,playerid,reason); // it sends the death message (icon killer > player with this weapon)
SetPlayerScore(killerid,GetPlayerScore(killerid)+2); // it sets +2 score ( old score + 2 )
playercash = GetPlayerMoney(playerid); // it assignes a value to the first variable with the playerid's money
if (playercash > 100) // if the cash is greater than 100
{
GivePlayerMoney(killerid, playercash); // then it gives the money to the killer
GivePlayerMoney(playerid, -100); // it sets playerid's money to 0 <<<< I CHANGES THIS.
}
else // if the cash is lower than 100 or equal to 100
{
// do something;
}
}
return 1; // return a value to the callback
}
Thanks Dwane, for helping support his theory that he needs to do nothing in life to get everything he wants. Promoting laziness is idiotic.
|