Jump to content

[REZOLVAT] Problema - licente


Ionut09
 Share

Recommended Posts

7 minutes ago, Leonard said:

In baza de date se insereaza corect?

Repet, problema o am doar daca dau relog, doar daca dau /agl id all, daca dau /agl id driving , pilots si asa mai departe, nu am aceasta problema. raman licentele.

Link to comment
Share on other sites

  • Administrator
Acum 1 minut, Ionut09 a spus:

Repet, problema o am doar daca dau relog, doar daca dau /agl id all, daca dau /agl id driving , pilots si asa mai departe, nu am aceasta problema. raman licentele.

Atunci problema e de la cod, nu ai facut tu ceva bine, lasa comanda /agl aici.

Link to comment
Share on other sites

CMD:agl(playerid,params[])
{
    if(gPlayerLogged[playerid] == 0) return SCM(playerid, COLOR_LIGHTRED, "Nu esti logat.");
    if(!Iter_Contains(Player, playerid)) return true;

    if(PlayerInfo[playerid][pAdmin] >= 2) return SendClientMessage(playerid, COLOR_ERROR, AdminOnly);

    new id, x_nr[10], string[128], licence[10];

    if(sscanf(params, "us[10]", id, x_nr)) return SendUsage(playerid, "{25FDE9}Usage: {25FDE9}agl <Name/playerid> <License>", "Available names: Driving, Pilots, Sailing, Weapon, All."); 
    if(!Iter_Contains(Player, id)) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");

    if(strcmp(x_nr, "driving", true) == 0)
    { 
    	licence[0] = (EOS);
    	format(licence, sizeof(licence), "driving");

        PlayerInfo[id][pCarLic] = 1;
        PlayerInfo[id][pCarLicT] = 100;
        PlayerInfo[id][pCarLicSuspend] = 0;
        Update(id, pCarLicSuspendx);
 
 		string[0] = (EOS);
        mysql_format(SQL, string, 128, "UPDATE users SET `CarLic`='1', `CarLicT`='100' WHERE `id`='%s'", PlayerInfo[id][pSQLID]);
        mysql_tquery(SQL, string, "", "");

    }
    else if(strcmp(x_nr, "pilots", true) == 0)
    { 
    	licence[0] = (EOS);
    	format(licence, sizeof(licence), "pilot");

        PlayerInfo[id][pFlyLic] = 1;
        PlayerInfo[id][pFlyLicT] = 100;

        string[0] = (EOS);
        mysql_format(SQL, string, 128, "UPDATE users SET `FlyLic`='1', `FlyLicT`='100' WHERE `id`='%s'", PlayerInfo[id][pSQLID]);
        mysql_tquery(SQL, string, "", "");  

    }
    else if(strcmp(x_nr, "sailing", true) == 0)
    { 
    	licence[0] = (EOS);
    	format(licence, sizeof(licence), "sailing");

        PlayerInfo[id][pBoatLic] = 1;
        PlayerInfo[id][pBoatLicT] = 100;

        string[0] = (EOS);
        mysql_format(SQL, string, 128, "UPDATE users SET `BoatLic`='1', `BoatLicT`='100' WHERE `id`='%s'", PlayerInfo[id][pSQLID]);
        mysql_tquery(SQL, string, "", "");   

    }
    else if(strcmp(x_nr, "weapon", true) == 0)
    {
    	licence[0] = (EOS);
    	format(licence, sizeof(licence), "weapon");

        PlayerInfo[id][pGunLic] = 1;
        PlayerInfo[id][pGunLicT] = 100;
        PlayerInfo[id][pGunLicSuspend] = 0;
        Update(id, pGunLicSuspendx);

        string[0] = (EOS);
        mysql_format(SQL, string, 128, "UPDATE users SET `GunLic`='1', `GunLicT`='100' WHERE `id`='%s'", PlayerInfo[id][pSQLID]);
        mysql_tquery(SQL, string, "", "");    

    }
    else if(strcmp(x_nr, "all", true) == 0)
    {
    	licence[0] = (EOS);
    	format(licence, sizeof(licence), "all");

        PlayerInfo[id][pGunLic] = 1;
        PlayerInfo[id][pGunLicT] = 100;
        PlayerInfo[id][pGunLicSuspend] = 0;

        PlayerInfo[id][pBoatLic] = 1;
        PlayerInfo[id][pBoatLicT] = 100;

        PlayerInfo[id][pFlyLic] = 1;
        PlayerInfo[id][pFlyLicT] = 100;

        PlayerInfo[id][pCarLic] = 1;
        PlayerInfo[id][pCarLicT] = 100;
        PlayerInfo[id][pCarLicSuspend] = 0;

        Update(id, pGunLicSuspendx);
        Update(id, pCarLicSuspendx);

        string[0] = (EOS);
        mysql_format(SQL, string, 128, "UPDATE users SET `GunLic`='1', `GunLicT`='100', `BoatLic` = '1', `BoatLicT` = '100', `FlyLic` = '1', `FlyLicT` = '100', `CarLic` = '1', `CarLicT` = '100' WHERE `id`='%s'", PlayerInfo[id][pSQLID]);
        mysql_tquery(SQL, string, "", "");    

    } 


    format(string, sizeof(string), "* You've given a %s License to %s.", GetName(id), licence);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

    format(string, sizeof(string), "* Admin %s has given you a %s License.", GetName(playerid), licence);
    SendClientMessage(id, COLOR_LIGHTBLUE, string);

    return 1;
}

SendUsage(playerid, str[], str2[]) {

	SendClientMessage(playerid, COLOR_WHITE, str);
    SendClientMessage(playerid, COLOR_WHITE, str2);

	return true;
}

incearca, n am testat

Link to comment
Share on other sites

scz nu am vazut ca ai rezolvat!!

 

cred ca mysql e foarte atent la minuscule si majuscule, sa fie oare de aici: 

mysql_format(SQL,str,128,"UPDATE users SET `GunLic`='1',`GunLicT`='100',`BoatLic`='1',`BoatLicT`='100',`FlyLic`='1',`FlyLicT`='100',`CarLic`='1',`CarLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
                mysql_tquery(SQL,str,"","");

ia pune asa :
 

mysql_format(SQL,str,128,"UPDATE `users` SET `GunLic`='1',`GunLicT`='100',`BoatLic`='1',`BoatLicT`='100',`FlyLic`='1',`FlyLicT`='100',`CarLic`='1',`CarLicT`='100' WHERE `Name`='%s'",PlayerInfo[id][pNormalName]);
                mysql_tquery(SQL,str,"","");
Edited by Atrocity
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...