one little thing
#1

I just get out of my minds!
I don't know what's wrong here

pawn Код:
if(strcmp(cmd, "/jack", true) == 0)
    {
        new newcar = GetPlayerVehicleID(playerid);
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            if(DynamicCars[GetPlayerVehicleID(playerid)-1][CarType] != 1 || !IsAnOwnableCar(newcar) || DynamicCars[newcar][cOwned] == 0 )
                {
                    if(EngineStatus[GetPlayerVehicleID(playerid)] == 0)
                    {
                            new jacktime;
                            if(PlayerInfo[playerid][pToolKit] == 1)
                            {
                                SendClientMessage(playerid,COLOR_GREEN,"Jacking,please wait 210 seconds!");
                                GameTextForPlayer(playerid,"Jacking",10000,1);
                                new countdowns = 210;
                                SetTimerEx("FirstJack", 210000, false, "i", 1, "");
                                CountdownSeconds = countdowns;
                                CountdownTimer = SetTimer("CountDown",1000,true);
                                format(string, sizeof(string),"~r~Jacking: ~b~%d",countdowns);
                                TextDrawSetString(Textdraw46, string);
                                TextDrawShowForPlayer(playerid,Textdraw46);
                            }
                            if(PlayerInfo[playerid][pToolKit] == 2)
                            {
                                SendClientMessage(playerid,COLOR_GREEN,"Jacking,please wait 110 seconds!");
                                GameTextForPlayer(playerid,"Jacking",10000,1);
                                new countdowns = 110;
                                SetTimerEx("FirstJack", 110000, false, "i", 1, "");
                                CountdownSeconds = countdowns;
                                CountdownTimer = SetTimer("CountDown",1000,true);
                                format(string, sizeof(string),"~p~Jack: ~w~%d",countdowns);
                                TextDrawSetString(Textdraw46, string);
                                TextDrawShowForPlayer(playerid,Textdraw46);

                            }
                            if(PlayerInfo[playerid][pToolKit] == 3)
                            {
                                SendClientMessage(playerid,COLOR_GREEN,"Jacking,please wait 50 seconds!");
                                GameTextForPlayer(playerid,"Jacking",10000,1);
                                new countdowns = 50;
                                SetTimerEx("FirstJack", 50000, false, "i", 1, "");
                                CountdownSeconds = countdowns;
                                CountdownTimer = SetTimer("CountDown",1000,true);
                                format(string, sizeof(string),"~p~Jack: ~w~%d",countdowns);
                                TextDrawSetString(Textdraw46, string);
                                TextDrawShowForPlayer(playerid,Textdraw46);
                            }
                    }
                    else
                    {
                        SendClientMessage(playerid,COLOR_WHITE,"The engine is already started,don't need to jack it");
                    }
                }
                else
                {
                    SendClientMessage(playerid,COLOR_RED,"Only street cars");
                }
        }
        else
        {
            SendClientMessage(playerid,COLOR_RED,"You need to be the driver!");
        }
        return 1;
    }
pawn Код:
forward FirstJack(playerid);
public FirstJack(playerid)
{
    TextDrawHideForPlayer(playerid,Textdraw46);
    TogglePlayerControllable(playerid,1);
    GameTextForPlayer(playerid,"Jacked~n~Good Work",5000,5);
    PlayerInfo[playerid][pToolKit] = 0;
    TextDrawHideForPlayer(playerid, Textdraw46);
    return 1;
}
why the timers are not working?
I type /jack,everything is working(textdraw,etc.) but when the textdraw is ending nothing happens ...That means that the timer is not working.
i've tried to replace Settimer("firstjack"..) with
pawn Код:
FirstJack(playerid);
and it worked but i need a timer
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=201799 ??

Remove the "" at the end of all your SetTimerEx, they might cause problems, as you only need to submit one parameter. The 1 after the "i" should also not be a 1, but playerid, because this is the variable you need to pass to the "FirstJack"

SetTimerEx("FirstJack", 110000, false, "i", playerid);
Reply
#3

Idk what happened..i said is fixed because it worked,now it is bugged again.
Reply
#4

GOD,it is working.Thank you so much mauzen!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)