[Help] Specific Points
#1

Hello , i have points system in my server which is following . But i want that admin can give specific points . I mean that admin can only give player points that can be divided by 0.25 . So that admins will be able to give them only 0.25 points , 0.50 points , 0.75 points , 1.00 points , 1.25 points and so on.
Following is my code.
PHP код:
CMD:givepp(playeridparams[])
{
    
LoginCheck(playerid);
    if(
User[playerid][accountAdmin] >= 3)
    {
        new 
string[150], idamount;
    
        if(
sscanf(params"ui"idamount)) return SendClientMessage(playeridCOLOR_RED"USAGE: /givepp [playerid] [amount]");
        if(
id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1"» "red"Player not connected.");
        if(
User[id][accountLogged] == false) return SendClientMessage(playerid, -1"» "red"Player not logged in.");
        
format(string150"[PREMIUM POINTS] "red"%s has given %s [%d] Premium Points."GetName(playerid), GetName(id), amount);
        
SendAMessage(-1string);
        
format(string150""green"[PREMIUM POINTS] "white"You have received "grey"%d "white"premium points from an "red"admin"white"."amountUser[id][accountPP]+amount);
        
SendClientMessage(id, -1string);
        
format(string150"» You have given {%06x}%s "white"premium points of "grey"%d"white"."GetPlayerColor(id) >>> 8GetName(id), amount);
        
SendClientMessage(playerid, -1string);
        
format(string128"%s received %d Premium Points from %s."GetName(id), amountGetName(playerid));
        
Log("premium.txt"string);
        
User[id][accountPP] += amount;
    }
    else
    {
        
SendClientMessage(playerid, -1"» "red"You are not authorized to use this command.");
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)