[AJUDA] /fumaca
#6

pawn Код:
new smoke[MAX_VEHICLES];
new LastVehicle[MAX_PLAYERS];
new bool:smoking[MAX_VEHICLES] = false; // todas devem ser variaveis globais

    if (!strcmp(cmdtext, "/fumaca", true))
    {
        new vehid = GetPlayerVehicleID(playerid);
        new carid = GetVehicleModel(vehid);
        if(carid == 511 || carid == 512 || carid == 593 || carid == 520 || carid == 553 || carid == 476 || carid == 519 || carid == 460)
        {
            if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                if(!smoking[vehid])
                {
                    smoke[vehid] = CreateObject(2780,0,0,0,0,0,50000);
                    AttachObjectToVehicle(smoke[vehid], vehid, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
                    smoking[vehid] = true;
                    return SendClientMessage(playerid, COLOR_WHITE, "Fumaca ligada.");
                }
                else
                {
                    DestroyObject(smoke[vehid]);
                    smoking[vehid] = false;
                    return SendClientMessage(playerid, COLOR_WHITE, "Fumaca desligada.");
                }
            }
            else return SendClientMessage(playerid, -1, "Vocк nгo estб dirigindo a aeronave!");
        }
        else return SendClientMessage(playerid, -1, "Vocк nгo estб em uma aeronave!");
    }


    //public onplayerstatechange
    if(newstate == PLAYER_STATE_DRIVER)
        LastVehicle[playerid] = GetPlayerVehicleID(playerid);
    if(oldstate == PLAYER_STATE_DRIVER)
    {
        if(smoking[LastVehicle[playerid]])
            DestroyObject(LastVehicle[playerid]);
        LastVehicle[playerid] = 0;
    }
Estranho, n vejo motivo pra dar problema no codigo....
Reply


Messages In This Thread
[AJUDA] /fumaca - by Mattos - 25.11.2011, 16:44
Re: [AJUDA] /fumaca - by |_MeGaTroN_| - 25.11.2011, 16:54
Re: [AJUDA] /fumaca - by Pharrel - 25.11.2011, 16:56
Re: [AJUDA] /fumaca - by Mattos - 25.11.2011, 17:03
Re: [AJUDA] /fumaca - by |_MeGaTroN_| - 25.11.2011, 17:22
Re: [AJUDA] /fumaca - by Pharrel - 25.11.2011, 17:29
Re: [AJUDA] /fumaca - by Mattos - 25.11.2011, 17:38
Re: [AJUDA] /fumaca - by Pharrel - 25.11.2011, 17:41
Re: [AJUDA] /fumaca - by Mattos - 25.11.2011, 18:06
Re: [AJUDA] /fumaca - by |_MeGaTroN_| - 25.11.2011, 18:43

Forum Jump:


Users browsing this thread: 1 Guest(s)