Ranks
#4

pawn Код:
new Ranks[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    Ranks[playerid] = 0;
    return 1;
}


public OnPlayerDisconnect(playerid)
{
    Ranks[playerid] = 0;
    return 1;
}


public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPlayerScore(killerid) == 1) {
        SendClientMessage(killerid,-1,"SERVER: You just ranked up to 1 :D");
        Ranks[killerid] = 1;
    }
    return 1;
}


// now try to make something if player is rank 1

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/weaponrank1", cmdtext, true, 10) == 0) {
        if(Ranks[playerid] == 1) {
            GivePlayerWeapon(playerid,24,1000);
        }
        else {
            SendClientMessage(playerid,-1,"SERVER: You are not rank 1 :)");
        }
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
Ranks - by Trucker[UK] - 28.08.2011, 18:25
Re: Ranks - by [MWR]Blood - 28.08.2011, 18:30
Re: Ranks - by Trucker[UK] - 28.08.2011, 18:31
Re: Ranks - by Kitten - 28.08.2011, 18:56
Re: Ranks - by Trucker[UK] - 29.08.2011, 15:27

Forum Jump:


Users browsing this thread: 1 Guest(s)