Can somebody tell me how to create a rank system
#1

Hello, please, can somebody tell me how to create a rank system, like, at 50 kills your rank change to "2"
Please

Click here to download my gamemode

Other quiestions:
-How to make "Kills = Points" The amount of kills are the amount of points.
-When you Choose a "Team", make apear in the name ["TEAM"](NAME).


Well, thats all, please, i think somebody can help me.

I only have 3 weeks scripting.
Reply
#2

First of all, welcome to the forums

Second we dont need your gamemode ^^

Questions 1. Rank System:

You need to track the kills for that we create a global player array
pawn Код:
new gKills[MAX_PLAYERS];
and than we increase it for the player if he kills someone
pawn Код:
// OnPlayerDeath
    if(killerid != INVALID_PLAYER_ID) {
        gKills[killerid]++; // increases the variable by 1
    }
Question 2. Kills = Points:
pawn Код:
// OnPlayerDeath
    if(killerid != INVALID_PLAYER_ID) {
        gKills[killerid]++;
        SetPlayerScore(killerid, gKills[killerid]); // sets the kills as score
    }
Question 3. Teams:

pawn Код:
// Whenever you choose your team
    new
        name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof name); // gets the name
    format(name, sizeof name, "[%s]%s", THE_TEAM_NAME, name); // adds the team name before
    SetPlayerName(playerid, name); // sets the name again
Reply
#3

Oh, thanks, but i think all the ranks will be deleted, because thats not saved in a file, can somebody tell me how to save it in a file, please
Reply
#4

What saving method are you using?
Reply
#5

Dini
Reply
#6

dini are slow just change to SII or MySQL
i think mysql is the best saving method
Reply
#7

i only know how to use dini
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)