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

Question

Posted

Problema intalnita (descriere):De ceva timp nu mai merge comanda /hwithdraw totul sa intamplat dintro data cand dau /hwithdraw money 5000 nu zice nimic nu stiu ce are poate din cauza ca am bagat noi case pe sv nu stiu ce are
Ero(area / rile) / warning-(ul / urile):

 

CMD:hwithdraw(playerid, params[]) {
    new
        houseID = getPlayerHouseID(playerid); // So we don't have to loop every single time... It's worth the 4 bytes!

    if(getPlayerHouseID(playerid) >= 1) {
        if(GetPlayerVirtualWorld(playerid) == HOUSE_VIRTUAL_WORLD+houseID) {
            new
                amount,

                houseOperation[72]; // For formatting afterwards.

            if(sscanf(params, "s[32]d", houseOperation, amount))
                return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/hwithdraw [mone] [amount]");

            if(!strcmp(houseOperation, "500000", true)) {
                if(houseVariables[houseID][hMoney] >= amount) {
                    if(amount >= 1 && amount < 60000000) {
                        houseVariables[houseID][hMoney] -= 50000;
                        playerVariables[playerid][pMoney] +=50000;

                        if(houseVariables[houseID][hMoney] < 1)
                            houseVariables[houseID][hMoney] = 0;

                        if(playerVariables[playerid][pMoney] < 1)
                            playerVariables[playerid][pMoney] = 0;

                        format(houseOperation, sizeof(houseOperation), "You have withdrawn $%d from your safe.", amount);
                        SendClientMessage(playerid, COLOR_WHITE, houseOperation);

                        GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
                        format(houseOperation, sizeof(houseOperation), "* %s withdraws $%d from their safe.", szPlayerName, amount);
                        nearByMessage(playerid, COLOR_PURPLE, houseOperation);
                    }
                    else {
                        SendClientMessage(playerid, COLOR_GREY, "You can't withdraw a negative amount from a house safe. (01x03)");
                        printf("[error] 01x03, %d", playerid);
                    }
                }
            }
            else {
                return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/hwithdraw [money/materials] [amount]");
            }
        }
    }
    else {
        return SendClientMessage(playerid, COLOR_GREY, "You're not inside your house.");
    }
    return 1;
}


Liniile de cod / sursa / script-ul(obligatoriu):


Imagini / Video (optional):
Ati incercat sa rezolvati singur?:Am incercat sa bag din nou comanda de pe gm de la care am inceput sa editez la gm , am rebagat comanda si tot nu merge

4 answers to this question

Recommended Posts

  • 1
Posted (edited)

Poftim comanda reparata ..

 

CMD:hwithdraw(playerid, params[]) {
    new
        houseID = getPlayerHouseID(playerid), amount, houseOperation[72];
    if( !houseID ) return SendClientMessage(playerid, COLOR_GREY, "You're not inside your house.");
    if( GetPlayerVirtualWorld( playerid ) != HOUSE_VIRTUAL_WORLD + houseID ) return 1;
    if( sscanf( params, "d", amount ) ) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/hwithdraw [amount]");
    if( houseVariables[ houseID ][ hMoney ] < amount ) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/hwithdraw [money/materials] [amount]");
    if( amount >= 1 && amount < 60000000 ) {
        houseVariables[houseID][hMoney] -=  amount;
        playerVariables[playerid][pMoney] += amount;
        if(houseVariables[houseID][hMoney] < 1)
            houseVariables[houseID][hMoney] = 0;
        if(playerVariables[playerid][pMoney] < 1)
            playerVariables[playerid][pMoney] = 0;
        format(houseOperation, sizeof(houseOperation), "You have withdrawn $%d from your safe.", amount);
        SendClientMessage(playerid, COLOR_WHITE, houseOperation);
        GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
        format(houseOperation, sizeof(houseOperation), "* %s withdraws $%d from their safe.", szPlayerName, amount);
        nearByMessage(playerid, COLOR_PURPLE, houseOperation);
    }
    else {
        SendClientMessage(playerid, COLOR_GREY, "You can't withdraw a negative amount from a house safe. (01x03)");
        printf("[error] 01x03, %d", playerid);
    }
    return 1;
}
Edited by eXorcism

I'm back bitches.

  • 0
Posted

Incearca asta.

 

CMD:hwithdraw(playerid, params[]) {
	new
	    houseID = getPlayerHouseID(playerid); // So we don't have to loop every single time... It's worth the 4 bytes!

	if(getPlayerHouseID(playerid) >= 1) {
	    if(GetPlayerVirtualWorld(playerid) == HOUSE_VIRTUAL_WORLD+houseID) {
			new
			    amount,

			    houseOperation[72]; // For formatting afterwards.

			if(sscanf(params, "s[32]d", houseOperation, amount))
			    return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/hwithdraw [mone] [amount]");

		    if(!strcmp(houseOperation, "money", true)) {
		        if(houseVariables[houseID][hMoney] >= amount) {
		            if(amount >= 1 && amount < 60000000) {
		                houseVariables[houseID][hMoney] -= amount;
		                playerVariables[playerid][pMoney] += amount;

		                if(houseVariables[houseID][hMoney] < 1)
							houseVariables[houseID][hMoney] = 0;

		                if(playerVariables[playerid][pMoney] < 1)
							playerVariables[playerid][pMoney] = 0;

		                format(houseOperation, sizeof(houseOperation), "You have withdrawn $%d from your safe.", amount);
		                SendClientMessage(playerid, COLOR_WHITE, houseOperation);

						GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
						format(houseOperation, sizeof(houseOperation), "* %s withdraws $%d from their safe.", szPlayerName, amount);
						nearByMessage(playerid, COLOR_PURPLE, houseOperation);
		            }
					else {
						SendClientMessage(playerid, COLOR_GREY, "You can't withdraw a negative amount from a house safe. (01x03)");
						printf("[error] 01x03, %d", playerid);
					}
		        }
		    }
		    else {
				return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/hwithdraw [money/materials] [amount]");
			}
		}
    }
    else {
		return SendClientMessage(playerid, COLOR_GREY, "You're not inside your house.");
	}
	return 1;
}

 

j3V8Znq.png

5IGyOAw.png

  • 0
Posted

Sa inteleg ca s-a rezolvat.

Multumim pentru colaborare!

 O zi placuta in continuare.

Topic Closed.

 

 

Guest
This topic is now closed to further replies.
×
×
  • 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.