Only good Scripters(OnPlayerDeath(Scoring) )
#1

I want make counting killing and tell in game in type (sendclientmessage).
now I have been using:
In Start Code
pawn Код:
new oke[MAX_PlAYERS]
In OnPlayerCommandsText
pawn Код:
if(blabla(cmdtext, "/cmd", true,4))
{
oke[playerid] = 1;
return 1;
}
In OnPlayerDeath
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(oke[killerid] == 1 && oke[playerid] == 1)
    {
    // What to write here? help me please.. I do not know as make function..
      }
    return 1;
}
Help me please.. make scoring, i do not know as make these functions..

P:S and if I do not rightly begun to do the code - remake please..





Reply
#2

Someone knows how to do it?
or you do not understand what I am talking about?
Reply
#3

You're not a fluent English speaker, I barely understood what you wanted.

But, SetPlayerScore() and GetPlayerScore(), you'll obviously want to log the scores to a file, so you should really not bother with this, as inserting file data, making files and that sort of stuff is a bit out of your league at this time. Maybe, take a look at another GM and modify bits (don't claim it as your own).
Reply
#4

Why in the file?
I used to be a code, but I accidentally deleted (
It was done only in OnPLayerDeath
Scoring points and after the glasses make it to the end that was written PLAYERID win
Reply
#5

if you mean you want to tell a player his score when he kills someone then just this:


public OnPlayerDeath(playerid, killerid, reason){
new score = GetPlayerScore(killerid);
SetPlayerScore(killerid,score+1);
new str[128];
format(str,sizeof(str),"Your score is now %s",score);
SendClientMessage(killerid,blue,str);
}
Reply
#6

you can make a kill count by:
pawn Код:
new kills[MAX_PLAYERS]; // variable for the kill count


public OnPlayerDeath(playerid, killerid, reason){
kills[killerid]++; // will give the player some kill count ( 1 )
kills[playerid] = 0; // will reset the players kills as he has died and his streak has been reset
if(kills[killerid] > 5) // checks if the player has over 5 kills
{
 // code here E.X SendClientMessage(playerid, color,"Nice! You're on a streak with 5 kills in a row!");
}
//and other..
else if(kills[killerid] > 10) // checks if the player has over 10 kills
{
//same thing here
}
}
with the announcment:
pawn Код:
new str[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(killerid, pName, sizeof(pName));
format(str,sizeof(str),"-> %s is on a streak with *kills here* kills in a row!",pName);
SendClientMessageToAll(color here,str);
Reply
#7

almost, I need glasses to read, for example, players teleport to the right place, if 1 player killed 2 in chat says: "1 lead with the score% d (from)% d (schet2) against 2"
Reply
#8

Quote:
Originally Posted by clOoX
almost, I need glasses to read, for example, players teleport to the right place, if 1 player killed 2 in chat says: "1 lead with the score% d (from)% d (schet2) against 2"
You mean a duel?

http://forum.sa-mp.com/index.php?topic=83698.0
Reply
#9

You probably do not understand ... It is very difficult to explain in English I am from another country.
Okay, thank you who tried to help
Reply
#10

Quote:
Originally Posted by clOoX
You probably do not understand ... It is very difficult to explain in English I am from another country.
Okay, thank you who tried to help
Okay,you mean an arena where players can teleport.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
   if(oke[killerid] == 1 && oke[playerid] == 1) // will check if the player is 'oke' as in 'In The Arena' or sth
   {
     kills[killerid]++; // will give the player some kill count ( 1 )
     kills[playerid] = 0; // will reset the players kills as he has died and his streak has been reset
     if(kills[killerid] > 5) // checks if the player has over 5 kills
     {
       // code here E.X SendClientMessage(playerid, color,"Nice! You're on a streak with 5 kills in a row!");
     }
     else if(kills[killerid] > 10) // checks if the player has over 10 kills
     {
       //same thing here
     }
  }
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)