Jump to content
  • 0

Problema /asellbiz si /asellhouse


Question

Posted
  • Username :SpriteTV
  • Problema întâlnită:primesc niste erori de la mysql dar nu inteleg care ii treaba. 
  • Detalii despre problemă:mysql_store_result mysql_retrieve_row mysql_fetch_field_row
  • Ce ai încercat să faci înainte să postezi?: Nu am incercat ca nu cunosc bine problema ca nu le am cu mysql-ul chiar asa de bine.
  • Cod sursa (recomandat pastebin.com) :   erori. https://pastebin.com/vGiTq4rk comenzile.https://pastebin.com/vW8sN14k
  • Alte detalii : help plz.

5 answers to this question

Recommended Posts

  • 0
Posted
CMD:asellbiz(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
    {
        new house;
        if(sscanf(params, "d", house)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF9900}Scrie: {33CCFF}/asellbiz <Biz ID>");
        if (PlayerInfo[playerid][pAdmin] >= 5)
        {
            new ownerh[64],
                field[128],
                str2[256];
            format(field,128,"SELECT `Owner` FROM `bizz` WHERE `ID`='%d'",house);
            new Cache: result = mysql_query(SQL,field);

            if(cache_num_rows())
            {
                cache_get_field_content(0, "Owner", ownerh);

            }
            cache_delete(result)
            BizzInfo[house][bLocked] = 0;
            BizzInfo[house][bOwned] = 0;
            strmid(BizzInfo[house][bOwner], "The State", 0, strlen("The State"), 255);
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            GameTextForPlayer(playerid, "~w~You have sold this property", 10000, 3);
            mysql_format(SQL,str2,sizeof(str2),"UPDATE `bizz` SET `Locked`='0',`Owned`='0',`Owner`='The State' WHERE `ID`='%d'",house);
            mysql_tquery(SQL,str2,"","");
            mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `Bizz`='255' WHERE `name`='%s'",ownerh);
            mysql_tquery(SQL,str2,"","");
            OnPropTextdrawUpdate(2, house);
            return 1;
        }
        else return SendClientMessage(playerid, COLOR_WHITE, "{5CAD5C}Error: Your admin level isn't high enough to use this command.");
    }
    return 1;
}
CMD:asellhouse(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
    {
        new house;
        if(sscanf(params, "d", house)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF9900}Scrie: {33CCFF}/asellhouse <House ID>");
        if (PlayerInfo[playerid][pAdmin] >= 5)
        {
            new ownerh[64],
                field[128],
                str2[256];
            format(field,128,"SELECT `Owner` FROM `houses` WHERE `ID`='%d'",house);
            new Cache: result = mysql_query(SQL,field);

            if(cache_num_rows())
            {
                cache_get_field_content(0, "Owner", ownerh);

            }
            cache_delete(result)
            HouseInfo[house][hHel] = 0;
            //HouseInfo[house][hArm] = 0;
            HouseInfo[house][hLock] = 0;
            HouseInfo[house][hOwned] = 0;
            strmid(HouseInfo[house][hOwner], "The State", 0, strlen("The State"), 255);
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            mysql_format(SQL,str2,sizeof(str2),"UPDATE `houses` SET `Hel`='0',`Arm`='0',`Lockk`='0',`Owned`='0',`Owner`='The State' WHERE `ID`='%d'",house);
            mysql_tquery(SQL,str2,"","");
            mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `House`='999' WHERE `name`='%s'",ownerh);
            mysql_tquery(SQL,str2,"","");
            OnPropTextdrawUpdate(1, house);
            return 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "{5CAD5C}Error: Your admin level isn't high enough to use this command.");
        }
    }
    return 1;
}

Asta daca folosesti r39

  • 0
Posted
Acum 6 ore, Banditul a spus:

CMD:asellbiz(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
    {
        new house;
        if(sscanf(params, "d", house)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF9900}Scrie: {33CCFF}/asellbiz <Biz ID>");
        if (PlayerInfo[playerid][pAdmin] >= 5)
        {
            new ownerh[64],
                field[128],
                str2[256];
            format(field,128,"SELECT `Owner` FROM `bizz` WHERE `ID`='%d'",house);
            new Cache: result = mysql_query(SQL,field);

            if(cache_num_rows())
            {
                cache_get_field_content(0, "Owner", ownerh);

            }
            cache_delete(result)
            BizzInfo[house][bLocked] = 0;
            BizzInfo[house][bOwned] = 0;
            strmid(BizzInfo[house][bOwner], "The State", 0, strlen("The State"), 255);
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            GameTextForPlayer(playerid, "~w~You have sold this property", 10000, 3);
            mysql_format(SQL,str2,sizeof(str2),"UPDATE `bizz` SET `Locked`='0',`Owned`='0',`Owner`='The State' WHERE `ID`='%d'",house);
            mysql_tquery(SQL,str2,"","");
            mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `Bizz`='255' WHERE `name`='%s'",ownerh);
            mysql_tquery(SQL,str2,"","");
            OnPropTextdrawUpdate(2, house);
            return 1;
        }
        else return SendClientMessage(playerid, COLOR_WHITE, "{5CAD5C}Error: Your admin level isn't high enough to use this command.");
    }
    return 1;
}
CMD:asellhouse(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
    {
        new house;
        if(sscanf(params, "d", house)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF9900}Scrie: {33CCFF}/asellhouse <House ID>");
        if (PlayerInfo[playerid][pAdmin] >= 5)
        {
            new ownerh[64],
                field[128],
                str2[256];
            format(field,128,"SELECT `Owner` FROM `houses` WHERE `ID`='%d'",house);
            new Cache: result = mysql_query(SQL,field);

            if(cache_num_rows())
            {
                cache_get_field_content(0, "Owner", ownerh);

            }
            cache_delete(result)
            HouseInfo[house][hHel] = 0;
            //HouseInfo[house][hArm] = 0;
            HouseInfo[house][hLock] = 0;
            HouseInfo[house][hOwned] = 0;
            strmid(HouseInfo[house][hOwner], "The State", 0, strlen("The State"), 255);
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            mysql_format(SQL,str2,sizeof(str2),"UPDATE `houses` SET `Hel`='0',`Arm`='0',`Lockk`='0',`Owned`='0',`Owner`='The State' WHERE `ID`='%d'",house);
            mysql_tquery(SQL,str2,"","");
            mysql_format(SQL,str2,sizeof(str2),"UPDATE users SET `House`='999' WHERE `name`='%s'",ownerh);
            mysql_tquery(SQL,str2,"","");
            OnPropTextdrawUpdate(1, house);
            return 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "{5CAD5C}Error: Your admin level isn't high enough to use this command.");
        }
    }
    return 1;
}

Asta daca folosesti r39

Primesc asta acu

C:\Users\SpriteTV\Desktop\GameModeRPG\gamemodes\RP-RPG.pwn(38077) : error 001: expected token: ";", but found "-identifier-"
C:\Users\SpriteTV\Desktop\GameModeRPG\gamemodes\RP-RPG.pwn(38114) : error 001: expected token: ";", but found "-identifier-"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
[Finished in 20.4s]

Linile is astea
BizzInfo[house][bLocked] = 0;
HouseInfo[house][hHel] = 0;

 

  • 0
Posted

Pui ; dupa cache_delete si totu o sa fie ok. Totusi puteai vedea si tu faptul ca am omis sa pun ; nu doar sa dai fericit copy-paste si compile

  • Haha 1
  • 0
Posted
Acum 1 minut, Banditul a spus:

Pui ; dupa cache_delete si totu o sa fie ok. Totusi puteai vedea si tu faptul ca am omis sa pun ; nu doar sa dai fericit copy-paste si compile

Am vazut fix dupa ce postai problema :) ms foarte mult mane. Ai tot respect-ul meu ti-am lasat un pm

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.