/sell commands
#1

hey guys here is sell command i have maked but i need help when i do /sell house sold and when i do sell again its sell again and again help me if there wrongs

Код:
 if (strcmp("/sell", cmdtext) == 0)
    {
        for(new i; i<MAX_HOUSES; i++)
		{
            if(IsPlayerInRangeOfPoint(playerid, 2, 2242.5498046875, -1160.0283203125, 1029.00))
	    	{
                new Pname[24]; GetPlayerName(playerid, Pname, 24);
                if(strcmp(Pname, HouseInfo[i][HouseOwner]) != 0) return SendClientMessage(playerid, 0xF60000AA, "You don't own this house!");
                GivePlayerMoney(playerid, 50000);
                GameTextForPlayer(playerid, "~r~House Sold!", 2000, 3);
                HouseInfo[i][Owned] = 0;
                HouseInfo[i][HouseOwner] = 0;
                dini_Unset("Owners.ini", Pname);
                return 1;
            }
            SendClientMessage(playerid, 0xF60000AA, "You are not close enough to a house");
			return 1;
		}
        return 1;
	}
Reply
#2

Couldn't you post in the Making Houses tutorial and not wasting more posts with your stupid big black writing and stuff?

Next time, use the [pawn]
Restart your samp-server.exe, GMX is necessary. If it doesn't work, drop it likes it hot.
Reply
#3

more helps please
Reply
#4

just i need to know why i can /sell while i dont /buy the house i need help with this guys thats all
Reply
#5

Quote:
Originally Posted by [MKD]Max
Посмотреть сообщение
dude when i do /sell with out buy it sell house and give me money just tell me why the fuck i cant do the right give me code something dude
Here. Try it now?

pawn Код:
if (strcmp("/sell", cmdtext) == 0)
    {
        for(new i; i<MAX_HOUSES; i++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 2, HouseInfo[i]PickupX, HouseInfo[i]PickupY, HouseInfo[i]PickupZ))
            {
                new Pname[24]; GetPlayerName(playerid, Pname, 24);
                if(strcmp(Pname, HouseInfo[i][HouseOwner]) != 0) return SendClientMessage(playerid, 0xF60000AA, "You don't own this house!");
                GivePlayerMoney(playerid- HouseInfo[i][HouseSell]);
                GameTextForPlayer(playerid, "~r~House Sold!", 2000, 3);
                HouseInfo[i][Owned] = 0;
                HouseInfo[i][HouseOwner] = 0;
                HouseInfo[i][PickupX] = 9999.9999;
                HouseInfo[i][PickupY] = -9999.9999;
                HouseInfo[i][PickupZ] = 9999.9999;
                dini_Unset("Owners.ini", Pname);
                return 1;
            }
            SendClientMessage(playerid, 0xF60000AA, "You are not close enough to a house");
            return 1;
        }
        return 1;
    }
Was it just that too easy? Go learn Pawno and I will NEVER help you if you treat me like that.
Reply
#6

thanks dude very thanks its work and you help me
Reply
#7

Quote:
Originally Posted by [MKD]Max
Посмотреть сообщение
thanks dude very thanks its work and you help me
No problem, sorry for being a jackass on you. Enjoy =D
Reply
#8

Sorry for double posting, but here's the right code.

pawn Код:
if (strcmp("/sellhouse", cmdtext) == 0)
    {
        for(new i; i<MAX_HOUSES; i++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 2, HouseInfo[i][PickupX], HouseInfo[i][PickupY], HouseInfo[i][PickupZ]))
            {
                new Pname[24]; GetPlayerName(playerid, Pname, 24);
                if(strcmp(Pname, HouseInfo[i][HouseOwner]) != 0) return SendClientMessage(playerid, 0xF60000AA, "You don't own this house!");
                GivePlayerMoney(playerid, -HouseInfo[i][HouseSell]);
                GameTextForPlayer(playerid, "~r~House Sold!", 2000, 3);
                HouseInfo[i][Owned] = 0;
                HouseInfo[i][HouseOwner] = 0;
                HouseInfo[i][PickupX] = 9999.9999;
                HouseInfo[i][PickupY] = -9999.9999;
                HouseInfo[i][PickupZ] = 9999.9999;
                dini_Unset("Owners.ini", Pname);
                return 1;
            }
            SendClientMessage(playerid, 0xF60000AA, "You are not close enough to a house");
            return 1;
        }
        return 1;
    }
I fixed the errors.
Reply
#9

thanks for help and goodlukc dude
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)