Please Help! -
MinazAhmed - 14.02.2012
Can anyone please reply down here with a pawno thing that is When A Player Kills Another Player How To Give
Score And Money please someone make this pawno for me
Re: Please Help! -
emokidx - 14.02.2012
use OnPlayerDeath callback
then use GetPlayerScore, and SetPlayerScore. same for money "GetPlayerMoney" SetPlayerMoney
Re: Please Help! -
MinazAhmed - 14.02.2012
stukk don't get it create one for example plz
Re: Please Help! -
Twisted_Insane - 14.02.2012
He wants a whole system for saving, I think!
@Minaz
Hey! Why don't you just use and follow a nice tutorial for a registersystem?
https://sampforum.blast.hk/showthread.php?tid=267808
Here, you can't do anything wrong! Learn from it, and also, do everything step-by-step!
It will save money, score, adminlevel and the password of a player which joined your server!
Re: Please Help! -
RicaNiel - 14.02.2012
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
GivePlayerMoney(killerid,123124); // Do this or edit this on your type
SetPlayerScore(playerid,1); // Add this
GetPlayerScore(playerid);
return 1;
/*
You need a writing system to add score ever kills
or saving system
*/
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
gKills[killerid] += 1;
SetPlayerScore(killerid,gKills[killerid]);
return 1;
}
Re: Please Help! -
Dr.Heinz - 14.02.2012
Код:
SetPlayerScore(killerid, GetPlayerScore(killerid) + puttheamounthere); //killerid - the one who kills the player/ puttheamounthere - put any value that you want to set score to the killer
Код:
GivePlayerMoney(killerid, puttamounthere); //killerid - the one who kills the player/ puttheamounthere - put any value that you want to set cash to the killer
Quote:
Originally Posted by emokidx111
use OnPlayerDeath callback
then use GetPlayerScore, and SetPlayerScore. same for money "GetPlayerMoney" SetPlayerMoney
|
SetPlayerMoney? maybe you mean GivePlayerMoney + you don't need to GetPlayerMoney. it has automatic function.
Quote:
Originally Posted by RicaNiel
pawn Код:
SetPlayerScore(playerid,1); // Add this GetPlayerScore(playerid);
|
fail it must be like this
Код:
SetPlayerScore(killerid, GetPlayerScore(killerid) + amount);
look at your code before posting.
translation:
tingan mo muna ang code bago ka magpost
Re: Please Help! -
RicaNiel - 14.02.2012
Quote:
SetPlayerScore(killerid, GetPlayerScore(killerid) + amount);
|
but i think gKills is more effective ehh?
Re: Please Help! -
Twisted_Insane - 14.02.2012
Quote:
Originally Posted by RicaNiel
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) { GivePlayerMoney(killerid,123124); // Do this or edit this on your type SetPlayerScore(playerid,1); // Add this GetPlayerScore(playerid); return 1; /*
You need a writing system to add score ever kills or saving system
*/ }
|
Didn't you already read what I've written? The link explains more than enough, and with your little piece, he won't understand much! Btw, you didn't add such a code, which is nearly the most important!
PHP код:
PlayerInfo[playerid][pKills] ++;
Re: Please Help! -
RicaNiel - 14.02.2012
Quote:
Didn't you already read what I've written? The link explains more than enough, and with your little piece, he won't understand much! Btw, you didn't add such a code, which is nearly the most important!
|
My friend please read it again
he did not said about saving and writing system
all he wants is that when the player can kill another player
he wants to add score
and this will help
Re: Please Help! -
Dr.Heinz - 14.02.2012
Quote:
Originally Posted by RicaNiel
but i think gKills is more effective ehh?
|
Well that was a simple one. if you use reg/login system it would be like this
for example
pawn Код:
PlayerInfo[killerid][pDeaths]++;
or
pawn Код:
pInfo[killerid][pDeaths]++;
Twisted_Insane is correct but on this part
his wrong it must be