Jump to content

Question

Posted (edited)

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

15 answers to this question

Recommended Posts

  • 0
Posted (edited)
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
  • 0
Posted (edited)

Vezi la /rentroom sa nu fi pus din greseala 255 in loc de alt numar ceea ce poate cauza bugul. Codul este scris bine la comanda asta.

Edited by xpLode
  • 0
Posted

            if(PlayerInfo[playerid][pRent] != 0) return SCM(playerid, -1, "Ai deja o chirie!");
            PlayerInfo[playerid][pRent] = 0 ; si merge! 

  • 0
Posted (edited)
Acum 2 ore, H3AtonN a spus:

Frate,am pus,si tot nu merge.. tot asa imi scrie..

Imi poti da o poza?

Daca nu poti da-mi ip-ul de server! (pm)

Edited by MrAndy
  • 0
Posted

te pot ajuta eu, da-mi comanda /rentroom sa-o vad si am sa-ti rezolv bugul la unrentroom

  • 0
Posted
16 hours ago, H3AtonN said:

va rogg.. nu site chiar nimeni??

Ti-am zis sa-mi pui /rentroom, e asa de greu sa citesti?

  • 0
Posted

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;
    }

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.