Jump to content
  • 0

Question

Posted
Problema intalnita (descriere):Comanda /quitjob. Aceasta comanda cand o folosesc in joc imi zice ca trb sa mai astept 5 ore pana la /quitjob. Cum pot sa o fac sa mearga oricand fara sa mai astept nici 1 sec?
Ero(area / rile) / warning-(ul / urile):Nu am erori/warning-uri
Liniile de cod / sursa / script-ul(obligatoriu):
Imagini / Video (optional):

/*==============================================================================
Comanda: /quitjob
==============================================================================*/

    if(strcmp(cmd, "/quitjob", true) == 0)
    {
        if(IsPlayerConnected(playerid))
           {
               if(gPlayerLogged[playerid] != 0)
               {
                if(PlayerInfo[playerid][pJob] > 0)
                {
                    if(PlayerInfo[playerid][pDonateRank] > 0)
                    {
                        if(PlayerInfo[playerid][pContractTime] >= 2)
                        {
                            SendClientMessage(playerid, -1, "* You already forfilled your 1 hour Contract, and quited your Job.");
                            PlayerInfo[playerid][pJob] = 0;
                            PlayerInfo[playerid][pChar] = 0;
                            PlayerInfo[playerid][pContractTime] = 0;
                        }
                        else
                        {
                            new chours = 2 - PlayerInfo[playerid][pContractTime];
                            format(string, sizeof(string), "* You still have %d hours left to forfill and end your Contract.", chours / 2);
                            SendClientMessage(playerid, -1, string);
                        }
                    }
                    else
                    {
                        if(PlayerInfo[playerid][pContractTime] >= 10)
                        {
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You already forfilled your 5 hour Contract, and quited your Job.");
                            PlayerInfo[playerid][pJob] = 0;
                            PlayerInfo[playerid][pChar] = 0;
                            PlayerInfo[playerid][pContractTime] = 0;
                        }
                        else
                        {
                            new chours = 10 - PlayerInfo[playerid][pContractTime];
                            format(string, sizeof(string), "* You still have %d hours left to forfill and end your Contract.", chours / 2);
                            SendClientMessage(playerid, -1, string);
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, -1, ""ALBASTRU2"Nu ai nici un job !");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, -1, ""ALBASTRU2"Nu esti conectat !");
                return 1;
            }
        }
        return 1;
    }
 

Ati incercat sa rezolvati singur?:Da

2 answers to this question

Recommended Posts

  • 0
Posted

Salut,incearca asa.

if(strcmp(cmd, "/quitjob", true) == 0)
    {
        if(IsPlayerConnected(playerid))
           {
               if(gPlayerLogged[playerid] != 0)
               {
                if(PlayerInfo[playerid][pJob] > 0)
                {
                    if(PlayerInfo[playerid][pDonateRank] > 0)
                    {
                        if(PlayerInfo[playerid][pContractTime] >= 1)
                        {
                            SendClientMessage(playerid, -1, "* You already forfilled your 1 hour Contract, and quited your Job.");
                            PlayerInfo[playerid][pJob] = 0;
                            PlayerInfo[playerid][pChar] = 0;
                            PlayerInfo[playerid][pContractTime] = 0;
                        }
                    }
                    else
                    {
                        if(PlayerInfo[playerid][pContractTime] = 1)
                        {
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You already forfilled your 5 hour Contract, and quited your Job.");
                            PlayerInfo[playerid][pJob] = 0;
                            PlayerInfo[playerid][pChar] = 0;
                            PlayerInfo[playerid][pContractTime] = 0;
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, -1, ""ALBASTRU2"Nu ai nici un job !");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, -1, ""ALBASTRU2"Nu esti conectat !");
                return 1;
            }
        }
        return 1;
    }

 

 

 

  • 0
Posted

Uite aici comanda cea mai simpla, am avut si eu probleme de acest gen cand eram incepator asa ca o sa vina asa:

 

if(strcmp(cmd, "/quitjob", true) == 0)
    {
        if(IsPlayerConnected(playerid))
           {
               if(gPlayerLogged[playerid] != 0)
               {
                if(PlayerInfo[playerid][pJob] > 0)
                {
                    SendClientMessage(playerid, -1, "Ai renuntat la job.");
                    PlayerInfo[playerid][pJob] = 0;
                    PlayerInfo[playerid][pChar] = 0;
                    PlayerInfo[playerid][pContractTime] = 0;
                }
                else
                {
                    SCM(playerid,-1,"Nu ai niciun job.");
                    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.