Jump to content
  • 0

Problema /Unrentroom


H3AtonN

Question

Problema intalnita (descriere): Dau /Rentroom,comanda merge,si ma pune cu chirie,la casa respectiva,dar daca dau /unrent.. imi zice "Ai deja o chirie" Ce sa-i fac?
Ero(area / rile) / warning-(ul / urile): -
Liniile de cod / sursa / script-ul(obligatoriu):   

if(strcmp(cmd, "/unrentroom", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, playername, sizeof(playername));
            if(PlayerInfo[playerid][pRent] != 255) return SCM(playerid, -1, "Ai deja o chirie!");
            PlayerInfo[playerid][pRent] = 255;
            SendClientMessage(playerid, COLOR_WHITE, "Ai renuntat la chirie. Acum esti un om al strazii!");
        }
        return 1;
    }
Imagini / Video (optional): -
Ati incercat sa rezolvati singur?:  Da,nu am reusit.

Edited by H3AtonN
Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0
if(strcmp(cmd, "/unrentroom", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            //GetPlayerName(playerid, playername, sizeof(playername)); // inutil
			if(PlayerInfo[playerid][pHouseKey] != 255)
            {
                SendClientMessage(playerid, COLOR_WHITE, "Detii deja o casa, tasteaza /sellhouse!");
                return 1;
            }
			PlayerInfo[playerid][pRent] = 255;
            SendClientMessage(playerid, COLOR_WHITE, "Ai renuntat la chirie. Acum esti un om al strazii!");
        }
        return 1;
    }

 

incearca asa si zii daca merge...

Edited by sheNdjze
Link to comment
Share on other sites

  • 0

Frate asta e comanda

 

if(strcmp(cmd, "/unrentroom", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, playername, sizeof(playername));
            if(PlayerInfo[playerid][pRent] != 255) return SCM(playerid, -1, "Ai deja o chirie!");
            PlayerInfo[playerid][pRent] = 255;
            SendClientMessage(playerid, COLOR_WHITE, "Ai renuntat la chirie. Acum esti un om al strazii!");
        }
        return 1;
    }

Si asta e /rentroom

 

if(strcmp(cmd, "/rentroom", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new Float:oldposx, Float:oldposy, Float:oldposz;
            GetPlayerName(playerid, playername, sizeof(playername));
            GetPlayerPos(playerid, oldposx, oldposy, oldposz);
            for(new h = 0; h < sizeof(HouseInfo); h++)
            {
                if(PlayerToPoint(2.0, playerid, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]) && HouseInfo[h][hOwned] == 1 &&  HouseInfo[h][hRentabil] == 1)
                {
                    if(PlayerInfo[playerid][pHouseKey] != 255)
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "Detii deja o casa, tasteaza /sellhouse!");
                        return 1;
                    }
                    if(GetPlayerCash(playerid) > HouseInfo[h][hRent])
                    {
                        PlayerInfo[playerid][pRent] = h;
                        GivePlayerCash(playerid,-HouseInfo[h][hRent]);
                        HouseInfo[h][hTakings] = HouseInfo[h][hTakings]+HouseInfo[h][hRent];
                        SendClientMessage(playerid, COLOR_WHITE, "Felicitari! Acum esti chiriasul acestei case!");

                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "Nu ai aceasta suma de bani!");
                        return 1;
                    }
                }
            }
        }
        return 1;
    }

Link to comment
Share on other sites

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.