08.12.2011, 04:34
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;
}
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;
}