Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Version 1.1
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #define SCM SendClientMessage
- #define DIALOG_RANK 3010
- enum RankInfo
- {
- xp,
- level,
- prestige
- }
- new rInfo[MAX_PLAYERS][RankInfo];
- public OnPlayerDeath(playerid, killerid, reason)
- {
- rInfo[killerid][xp] += 2;
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(rInfo[playerid][xp] == 100)//Levels
- {
- new str[85];
- rInfo[playerid][level] ++;
- rInfo[playerid][xp] = 0;
- GivePlayerMoney(playerid, 50000);
- format(str, sizeof(str), "!CONGRATS! you have leveled up you are now level %d", rInfo[playerid][level]);
- SCM(playerid, -1, str);
- }
- if(rInfo[playerid][level] == 100)//Prestige levels
- {
- new str[85];
- rInfo[playerid][prestige] ++;
- rInfo[playerid][xp] = 0;
- rInfo[playerid][level] = 0;
- format(str, sizeof(str), "!CONGRATS! you have prestiged you are now Prestige Level %d", rInfo[playerid][level]);
- SCM(playerid, -1, str);
- }
- return 1;
- }
- CMD:ranks(playerid, params[])
- {
- new str[80], str1[100];
- format(str, sizeof(str), "\tXP: %d\n\tLevel: %d\n\tPrestige: &d\n", rInfo[playerid][xp], rInfo[playerid][level]);
- strcat(str1, str);
- ShowPlayerDialog(playerid, DIALOG_RANK, DIALOG_STYLE_MSGBOX, "Your Rank", str1, "Close", "");
- return 1;
- }
- CMD:givexp(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid))return 0;
- {
- rInfo[playerid][xp] += 50;
- }
- return 1;
- }
- CMD:givelvl(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid))return 0;
- {
- rInfo[playerid][level] += 50;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment