17.12.2013, 05:37
Quote:
Hey guys, can anyone tell me how can i make a rank system for players? I don't need any special commands for each ranks, just want the rank 3DTextabel appear on their name always after reaching the selected score. +rep for one who can help me
|
pawn Код:
//at the top
#define MAJOR 0
#define PRIVATE 1// defining a simple ranks
// and
new gRank[MAX_PLAYERS]; // making a varb for player's rank
pawn Код:
forward OnPlayerReachRank(playerid);
public OnPlayerReachRank(playerid)
{
new Float:X , Float:Y , Float:Z; // the coordinates of text
if(GetPlayerScore(playerid) => 50 && GetPlayerScore(playerid) < 100) // if his score is 50 and under 100
{
SendClientMessage(playerid, green, "Congratulations!, You have been promoted to private!");
gRank[playerid] = PRIVATE; // setting his rank
GetPlayerPos(playerid, X , Y , Z); // getting player pos for the 3dtext
Create3DTextLabel("Major", -1, X, Y, 20.0, 10.0, 0, 0); // text is major, color is -1, 20.0 is at head of the player(i guess so), 10.0 is the distance if it's able to see from, 0 is the world and 0 is the testLOS( if it can be seen through objects
}
if(GetPlayerScore(playerid) => 100 && GetPlayerScore(playerid) < 300) // if his score is 100 and under 300
{
SendClientMessage(playerid, green, "You have been promoted to major!");
gRank[playerid] = MAJOR; // setting his rank
}
return 1;
}