Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Question

Posted

Am si eu o problema, am incercat sa fac comanda wipehouses care sa faca toate casele la stat etc.

Din pacate am niste erori, stiu ca am gresit la foreach dar nush cum sa folosesc in acest caz.

Erori: 

Assets\YCMD.pwn(2409) : error 017: undefined symbol "results@YSII_Ag"
Assets\YCMD.pwn(2409) : error 017: undefined symbol "results@YSII_Ag"
Assets\YCMD.pwn(2409) : error 029: invalid expression, assumed zero
Assets\YCMD.pwn(2409) : fatal error 107: too many error messages on one line

Aici este comanda.

YCMD:wipehouses(playerid, params[], help) {
	new string[180], query[180];
	if(PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, COLOR_GREY, "Nu ai nivelul necesar de admin pentru a face asta.");
	new szQuery[256], Cache: results;
	format(szQuery, sizeof(szQuery), "SELECT * FROM `houses` ORDER BY `houses`.`ID` ASC");
	results = mysql_query(SQL, szQuery);
	
	foreach(results, i)
	{
		foreach(Player, i) {
			if(IsPlayerConnected(i) && PlayerInfo[i][pHouse] == i) {
				PlayerInfo[i][pHouse] = 999;
				PlayerInfo[i][pRented] = -1;
				Update(i, pHousex);
			}
		}
		HouseInfo[i][hHel] = 0;
		HouseInfo[i][hArm] = 0;
		HouseInfo[i][hLock] = 0;
		HouseInfo[i][hOwned] = 1;
		HouseInfo[i][hValue] = 0;
		format(query,sizeof(query),"UPDATE `houses` SET `Hel`='0',`Arm`='0',`Lockk`='0',`Owned`='1',`Owner`='The State',`Value`='0' WHERE `ID`='%d'",house);
		mysql_query(SQL,query);
		format(query,sizeof(query),"UPDATE users SET `House`='999' WHERE `name`='%s'",HouseInfo[i][hOwner]);
		mysql_query(SQL,query);	
		strmid(HouseInfo[i][hOwner], "The State", 0, strlen("The State"), 255);
		PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
		format(string, sizeof(string), "* Casa %d a fost vandut cu succes la stat!", i);
		SendClientMessage(playerid, COLOR_YELLOW, string);
		UpdateLabel(1, i);
	}
	cache_delete(results);	
	return 1;
}

 

1 answer to this question

Recommended Posts

  • 0
Posted (edited)
YCMD:wipehouses(playerid, params[], help) {
    new string[180], query[180];
    if(PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, COLOR_GREY, "Nu ai nivelul necesar de admin pentru a face asta.");
    for(new i = 1; i < sizeof(HouseInfo); i++)
    {
        foreach(Player, i) {
            if(IsPlayerConnected(i) && PlayerInfo[i][pHouse] == i) {
                PlayerInfo[i][pHouse] = 999;
                PlayerInfo[i][pRented] = -1;
                Update(i, pHousex);
            }
        }
        HouseInfo[i][hHel] = 0;
        HouseInfo[i][hArm] = 0;
        HouseInfo[i][hLock] = 0;
        HouseInfo[i][hOwned] = 1;
        HouseInfo[i][hValue] = 0;
        format(query,sizeof(query),"UPDATE `houses` SET `Hel`='0',`Arm`='0',`Lockk`='0',`Owned`='1',`Owner`='The State',`Value`='0' WHERE `ID`='%d'",house);
        mysql_query(SQL,query);
        format(query,sizeof(query),"UPDATE users SET `House`='999' WHERE `name`='%s'",HouseInfo[i][hOwner]);
        mysql_query(SQL,query);    
        strmid(HouseInfo[i][hOwner], "The State", 0, strlen("The State"), 255);
        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
        format(string, sizeof(string), "* Casa %d a fost vandut cu succes la stat!", i);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        UpdateLabel(1, i);
    }
    return 1;
}
Edited by MiritaXD

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.