Jump to content

[Ajutor]Comanda /givelicense


iReaLx

Recommended Posts

SAlutare, am o problema... atunci cand scriu coamanda /givelicense weapon ID nu mi apare niciun mesaj, nu mi apare nimic.. nu mi da licenta... uitati comanda

 

CMD:givelicense(playerid, params[])
{
    if(PinLogged[playerid] == 0)return SCM(playerid, COLOR_DARKNICERED,"{FFFFFF}{FFFFFF}Contul tau este {ff0000}blocat{ffffff}, foloseste {ff0000}/pin{ffffff} pentru a-l debloca..");
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pRank] >= 1)
        {
            new x_nr[30],id,sendername[30],giveplayer[30],string[128];
               if(sscanf(params, "s[50]u",x_nr,id))
            {
                SendClientMessage(playerid, COLOR_WHITE, "{FF9900}Scrie: {33CCFF}/givelicense <License name> <Name/Playerid>");
                SendClientMessage(playerid, COLOR_WHITE, "License: Sailing, Weapon, Flying.");
                return 1;
            }
            if(id == playerid) return SCM(playerid,COLOR_WHITE,"{FFB870}");
            if(strcmp(x_nr,"flying",true) == 0)
            {
                if(IsPlayerConnected(id))
                {
                    if(id != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        GetPlayerName(id, giveplayer, sizeof(giveplayer));
                        format(string, sizeof(string), "* You've given a Flying License to %s.",giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* Instructor %s has given you a Flying License.",sendername);
                        SendClientMessage(id, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* Instructor %s has given %s a Flying License.",sendername,giveplayer);
                        SendFamilyMessage(12,COLOR_WHITE,string);
                        PlayerInfo[id][pFlyLic] = 1;
                        PlayerInfo[id][pFlyLicT] = 100;
                        new str[256];
                        mysql_format(SQL,str,sizeof(str),"UPDATE users SET `FlyLic`='1',`FlyLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
                        mysql_tquery(SQL,str,"","");
                        PlayerInfo[playerid][pCommands]++;
                        Update(playerid,pCommandsx);
                        mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Commands`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pCommands],PlayerInfo[playerid][pNormalName]);
                        mysql_tquery(SQL,str,"","");
                        PlayerInfo[playerid][pLGiven] += 1;
                        Update(playerid, pLGivenx);
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");
                    return 1;
                }
            }
            else if(strcmp(x_nr,"sailing",true) == 0)
            {
                if(IsPlayerConnected(id))
                {
                    if(id != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        GetPlayerName(id, giveplayer, sizeof(giveplayer));
                        format(string, sizeof(string), "* You've given a Sailing License to %s.",giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* Instructor %s has given you a Sailing License.",sendername);
                        SendClientMessage(id, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* Instructor %s has given %s a Sailing License.",sendername,giveplayer);
                        SendFamilyMessage(12,COLOR_WHITE,string);
                        PlayerInfo[id][pBoatLic] = 1;
                        PlayerInfo[id][pBoatLicT] = 100;
                        new str[256];
                        mysql_format(SQL,str,sizeof(str),"UPDATE users SET `BoatLic`='1',`BoatLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
                        mysql_tquery(SQL,str,"","");
                        PlayerInfo[playerid][pCommands]++;
                        Update(playerid,pCommandsx);
                        mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Commands`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pCommands],PlayerInfo[playerid][pNormalName]);
                        mysql_tquery(SQL,str,"","");
                        PlayerInfo[playerid][pLGiven] += 1;
                        Update(playerid, pLGivenx);
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");
                    return 1;
                }
            }
            else if(strcmp(x_nr,"weapon",true) == 0)
            {
                if(IsPlayerConnected(id))
                {
                    if(id != INVALID_PLAYER_ID)
                    {
                        if(PlayerInfo[id][pLevel] < 3) return SCM(playerid,COLOR_WHITE,"{FFB870}This player does not have level 5.");
                        if(PlayerInfo[id][pGunLicSuspend] > 0) return SCM(playerid,COLOR_WHITE,"This player have gun license suspended.");
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        GetPlayerName(id, giveplayer, sizeof(giveplayer));
                        format(string, sizeof(string), "* You've given a Weapon License to %s.",giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* Instructor %s has given you a Weapon License.",sendername);
                        SendClientMessage(id, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* Instructor %s has given %s a Weapon License.",sendername,giveplayer);
                        SendFamilyMessage(12,COLOR_WHITE,string);
                        PlayerInfo[id][pGunLic] = 1;
                        PlayerInfo[id][pGunLicT] = 100;
                        new str[256];
                        mysql_format(SQL,str,sizeof(str),"UPDATE users SET `GunLic`='1',`GunLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
                        mysql_tquery(SQL,str,"","");
                        PlayerInfo[playerid][pCommands]++;
                        Update(playerid,pCommandsx);
                        mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Commands`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pCommands],PlayerInfo[playerid][pNormalName]);
                        mysql_tquery(SQL,str,"","");
                        PlayerInfo[playerid][pLGiven] += 1;
                        Update(playerid, pLGivenx);
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");
                    return 1;
                }
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "You are not a instructor.");
            return 1;
        }
    }
    return 1;
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.