Jump to content

Question

Posted

Salut , stie cineva de ce la aceasta comanda o pot folosii playerii normali , fara sa aiba admin isi pot da fondator singuri , nu imi dau seama de ce  : CMD:makeadmin(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
    {
        if (PlayerInfo[playerid][pAdmin] >= 0)
        {
            new id,adminlevel,sendername[30],giveplayer[30],string[200];
            if(sscanf(params, "ui",id,adminlevel)) return SendClientMessage(playerid, 0xFFFFFFFF, "{B8DBFF}Syntax: /makeadmin <Name/Playerid> <Admin Level>");
            if(IsPlayerConnected(id))
            {
                if(id != INVALID_PLAYER_ID)
                {
                    GetPlayerName(id, giveplayer, sizeof(giveplayer));
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    PlayerInfo[id][pAdmin] = adminlevel;
                    PlayerInfo[id][pChar] = 217;
                    SetPlayerSkin(id, 217);
                    printf("AdmCmd: %s has promoted %s to a level %d admin.", sendername, giveplayer, adminlevel);
                    format(string, sizeof(string), "You have been promoted to a level %d admin by %s.", adminlevel, sendername);
                    SendClientMessage(id, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "You have promoted %s to a level %d admin.", giveplayer,adminlevel);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "{f03337}Warning: Admin %s has set %s to a level %d admin.", sendername,giveplayer,adminlevel);
                    ABroadCast(COLOR_WHITE,string,4);
                     new wakaname[25];
                    GetPlayerName(id,wakaname,25);
                    new str[256];
                    format(str,256,"UPDATE users SET `Admin`='%d',`CChar`='%d' WHERE `name`='%s'",PlayerInfo[id][pAdmin],PlayerInfo[id][pChar],wakaname);
                    mysql_query(SQL,str);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, AdminOnly);
        }
    }
    return 1;
}

 

6 answers to this question

Recommended Posts

  • 0
Posted

In loc de :

if (PlayerInfo[playerid][pAdmin] >= 0)

Pune:

if(PlayerInfo[playerid][pAdmin] < 10) //Acel 10 este nivelul la care poti folosii comanda

 

  • Upvote 1
  • 0
Posted

Va multumesc .

As mai avea o problema cu odometers la masini , imi inregistreaza km iar dupa restart o ia de la 0 , de ce ?

TextDrawShowForPlayer(i, Odom);
                    format(str3,sizeof(str3),"Odometers: %.2f Km",CarInfo[OwnedVeh(vehicle)][cKM]);
                    TextDrawSetString(Odom, str3);
                }
            }
        }
    }
    return 1;
}

 

  • 0
Posted

Te poti orienta dupa culoarea sau pozitia masinii.

Respect acestei comunitati, dar mai presus respect membrilor ei !

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.