Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Thanks to SanRock for making this!
- #include <a_samp>
- new Text:Ranked[MAX_PLAYERS];
- enum pInfo
- {
- Rank,
- EXP
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- public OnPlayerSpawn(playerid)
- {
- if(PlayerInfo[playerid][EXP] == 50)
- {
- PlayerInfo[playerid][Rank] +=1;
- }
- if(PlayerInfo[playerid][EXP] == 150)
- {
- PlayerInfo[playerid][Rank] +=1;
- }
- if(PlayerInfo[playerid][EXP] == 300)
- {
- PlayerInfo[playerid][Rank] +=1;
- }
- if(PlayerInfo[playerid][EXP] == 400)
- {
- PlayerInfo[playerid][Rank] +=1;
- }
- if(PlayerInfo[playerid][EXP] == 500)
- {
- PlayerInfo[playerid][Rank] +=1;
- }
- if(PlayerInfo[playerid][EXP] == 650)
- {
- PlayerInfo[playerid][Rank] +=1;
- }
- if(PlayerInfo[playerid][EXP] == 800)
- {
- PlayerInfo[playerid][Rank] +=1;
- }
- if(PlayerInfo[playerid][EXP] == 1000)
- {
- PlayerInfo[playerid][Rank] +=1;
- }
- if(PlayerInfo[playerid][EXP] == 1500)
- {
- PlayerInfo[playerid][Rank] +=1;
- }
- if(PlayerInfo[playerid][EXP] == 3000)
- {
- PlayerInfo[playerid][Rank] +=1;
- }
- TextDrawShowForPlayer(playerid,Text:Ranked[playerid]);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- Ranked[playerid] = TextDrawCreate(18.000000,428.000000,"~w~Rank Name: ~w~0 ~w~Rank: ~w~0/10");
- TextDrawAlignment(Ranked[playerid],0);
- TextDrawBackgroundColor(Ranked[playerid],255);
- TextDrawFont(Ranked[playerid],1);
- TextDrawLetterSize(Ranked[playerid],0.355555,0.955555);
- TextDrawColor(Ranked[playerid],-1);
- TextDrawSetOutline(Ranked[playerid],1);
- TextDrawSetProportional(Ranked[playerid],1);
- TextDrawSetShadow(Ranked[playerid],1);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- PlayerInfo[killerid][EXP] += 1;
- GivePlayerMoney(killerid, 5000);
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- new str[256];
- format(str,sizeof(str),"~w~Rank Name: ~w~%s ~w~Rank: ~w~%d/10",GetRankName(playerid), PlayerInfo[playerid][Rank]);
- TextDrawSetString(Text:Ranked[playerid],str);
- return 1;
- }
- stock GetRankName(playerid)
- {
- new str[64];
- if (PlayerInfo[playerid][Rank] == 0) str = ("Newbie");
- if (PlayerInfo[playerid][Rank] == 1) str = ("Survivor");
- if (PlayerInfo[playerid][Rank] == 2) str = ("Pro Survivor");
- if (PlayerInfo[playerid][Rank] == 3) str = ("Killer");
- if (PlayerInfo[playerid][Rank] == 4) str = ("Pro Killer");
- if (PlayerInfo[playerid][Rank] == 5) str = ("Master");
- if (PlayerInfo[playerid][Rank] == 6) str = ("Master Survivor");
- if (PlayerInfo[playerid][Rank] == 7) str = ("Master Killer");
- if (PlayerInfo[playerid][Rank] == 8) str = ("Skilled Survivor");
- if (PlayerInfo[playerid][Rank] == 9) str = ("Skilled Killer");
- if (PlayerInfo[playerid][Rank] == 10) str = ("Da Boss");
- return str;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement