Please Help!
#1

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
Reply
#2

use OnPlayerDeath callback
then use GetPlayerScore, and SetPlayerScore. same for money "GetPlayerMoney" SetPlayerMoney
Reply
#3

stukk don't get it create one for example plz
Reply
#4

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!
Reply
#5

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 Код:
gKils[MAX_PLAYER_NAME];
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    gKills[killerid] += 1;
    SetPlayerScore(killerid,gKills[killerid]);
    return 1;
}
Reply
#6

Код:
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
Reply
#7

Quote:

SetPlayerScore(killerid, GetPlayerScore(killerid) + amount);

but i think gKills is more effective ehh?
Reply
#8

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] ++; 
Reply
#9

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

pawn Код:
gKills
Reply
#10

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

pawn Код:
[playerid]
his wrong it must be

pawn Код:
[killerid]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)