[SOLVED]Looking for help...
#1

Hello,
Can anybody please tell me how to make it so for example when player score reaches 50, message formats to all which says:
">>> Player1 advanced to Rank1 by killing 50 players"

I use pInfo[playerid][ pScore ] ...

Thanks.
Reply
#2

wherever you change the playerscore put this:


pawn Код:
stock playerScoreUpdate(playerid)
{
 if(pInfo[playerid][pScore] != 50) return;
 new msg[128];
 new name[MAX_PLAYER_NAME];
 GetPlayerName(playerid, name, sizeof(name));
 format(msg, sizeof(msg), "%s(%d) advanced to Rank1 by killing 50 players", name, playerid);
 SendClientMessageToAll(0xAAAAAAAA, msg);
//Do your rank increase here, guessing its something like pInfo[playerid][pRank] = 1?

}
Reply
#3

Thanks man
Reply
#4

Uhmm I just tested it, and I get no errors or warnings when compile, but the problem is... when I reach 50 kills, nothing happens (no message at all)

Anybody know what's the problem??
Reply
#5

pawn Код:
playerScoreUpdate(playerid);
Do you have it near pInfo[playerid][pScore] = ?
Reply
#6

No it's far away from it, nearly bottom of the script...

Where should I put it??
Reply
#7

Example:

pawn Код:
pInfo[playerid][pScore]++;
playerScoreUpdate(playerid);
Reply
#8

Yah, wherever you increase your player score, you need to call that function right after it.
Reply
#9

Hmm I guess I was wrong, it's not pInfo[playerid][pScore] it's PlayerInfo[playerid][pKills]...
But anyways when I try to put it right after PlayerInfo[playerid][pKills]++ , in game when I reach 50 kills, it forms message with "KilledPerson(KilledPersonID) advanced to Rank1 by killing 50 players"

How can I change it so I have "Killer(KillerID) advanced to Rank1 by killing 50 players"

Thanks in advance....

Here is the code I use...

pawn Код:
public OnPlayerDeath( playerid, killerid, reason )
{
  new killedplayer[ MAX_PLAYER_NAME ], string[ 256 ];
    new bool:NotMurdered;
   
    for(new x=0; x<=SLOTS; x++) {
      if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && SpectateID[x] == playerid) {
            AdvanceSpectate(x);
        }
    }
   
    PlayerInfo[playerid][ pSpawned ]=0;
    SetPlayerWorldBounds(playerid, 30000.0, -30000.0, 30000.0, -30000.0);
    ResetPlayerWeapons(playerid);

  if (killerid == INVALID_PLAYER_ID) {
      SendDeathMessage( INVALID_PLAYER_ID, playerid, reason );
      NotMurdered = true;
      SetPlayerWantedLevel( playerid, 0 );
      if (PlayerInfo[playerid][ pPlayingAGame ] == 0) {
        TeamInfo[ GetPlayerTeam(playerid) ][ HomiesDied ]++;
      TeamInfo[ GetPlayerTeam(playerid) ][ TeamScore ]--;
      PlayerInfo[playerid][ pDeaths ]++;
        }
    }
   
    if (!NotMurdered) SendDeathMessage( killerid, playerid, reason );
   
    if(PlayerInfo[playerid][ pRacing  ]==1
    || PlayerInfo[playerid][ pDMing  ]==1
    || PlayerInfo[playerid][ pDerbying ]==1)
    {
      OnPlayerDeath_Rgames(playerid);
      OnPlayerDeath_DMgames(playerid);
      OnPlayerDeath_DDgames(playerid);
    }
   
  if(GetPlayerTeam(playerid) != GetPlayerTeam(killerid)) // Valid kill
    {
     SetPlayerScore( killerid, GetPlayerScore( killerid ) +1 );
     GivePlayerMoney( killerid, 500 );
     SetPlayerWantedLevel( killerid, GetPlayerWantedLevel( killerid )+1 );
     TeamInfo[ GetPlayerTeam(killerid) ][ RivalsKilled ]++;
     TeamInfo[ GetPlayerTeam(playerid) ][ HomiesDied ]++;
     TeamInfo[ GetPlayerTeam(killerid) ][ TeamScore ]++;
     TeamInfo[ GetPlayerTeam(playerid) ][ TeamScore ]--;
     PlayerInfo[playerid][ pDeaths ]++;
     PlayerInfo[killerid][ pKills ]++;
     playerScoreUpdate(playerid);
     
     OnPlayerDeath_TWS(playerid, killerid, reason);
Please help as soon as possible!
Reply
#10

Anyone know possible solution, please...?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)