How to get name from score
#2

pawn Код:
forward Bonus(playerid);
public Bonus(playerid)
{
    if(GetPlayerScore(playerid) == 100)//General of the army
    {
        new szPlayerName[MAX_PLAYER_NAME], szMessage[74];
        GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

        format(szMessage, sizeof(szMessage), "%s is now a member of the ministry ", szPlayerName);
        SendClientMessageToAll(0xff0000FF, szMessage);  // Replace 0 with the colour
    }
    GivePlayerMoney(playerid, 500000);//[EDITABLE]
    return 1;
}
not sure if it will work but another way is

1.open script.
2.press ctrl + h.
3.Search for: SetPlayerScore, Replace with: N_SetPlayerScore
4.Replace all.
5. Paste this into script.

pawn Код:
stock N_SetPlayerScore(playerid, score)
{
    new oldscore= GetPlayerScore(playerid);
    SetPlayerScore(playerid, score);
    OnPlayerScoreChange(playerid, oldscore, score);
    return 1;
}

forward OnPlayerScoreChange(playerid, oldscore, newscore);
public OnPlayerScoreChange(playerid, oldscore, newscore)
{
    if(newscore == 100)
    {
        new szPlayerName[MAX_PLAYER_NAME], szMessage[74];
        GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
        format(szMessage, sizeof(szMessage), "%s is now a member of the ministry ", szPlayerName);
        SendClientMessageToAll(0xff0000FF, szMessage);
    }
    return 1;
}
And use N_SetPlayerScore from now on
Reply


Messages In This Thread
How to get name from score - by [LHT]Bally - 08.12.2011, 03:58
Re: How to get name from score - by THE_KNOWN - 08.12.2011, 04:34
Re: How to get name from score - by [ABK]Antonio - 08.12.2011, 06:02
Re: How to get name from score - by Rob_Maate - 08.12.2011, 07:41

Forum Jump:


Users browsing this thread: 2 Guest(s)