Timer not starting
#4

here is a proper indentation for the code
PHP код:
forward InizioBici(playerid);
public 
InizioBici(playerid)
{
    
Lorenzo[playerid] = SetTimerEx("Mobike1"1000true"d"playerid);
    new 
vid GetPlayerVehicleID(playerid);
    
TextDrawShowForPlayer(playeridTextdrawbike0);
    
TextDrawShowForPlayer(playeridTextdrawbike1);
    
PlayerTextDrawShow(playeridTextdrawbike2[playerid]);
    
PlayerTextDrawShow(playeridTextdrawbike3[playerid]);
    
GetVehicleParamsEx(VeicoloAffittato[playerid], Engine[vid], Lights[vid], alarm[vid], doors[vid], bonnet[vid], boot[vid], objective[vid]);
    
SetVehicleParamsEx(VeicoloAffittato[playerid], 1Lights[vid], alarm[vid], doors[vid], bonnet[vid], boot[vid], objective[vid]);
    return 
1;
}
forward Mobike1(playerid);
public 
Mobike1(playerid)
{
    new 
ore[MAX_PLAYERS], minuti[MAX_PLAYERS], secondi[MAX_PLAYERS];
    new 
string[126], str[126], str1[126];
    new 
prezzo1[MAX_PLAYERS];
    new 
prezzo[MAX_PLAYERS];
    
prezzo1[playerid] = ore[playerid]*60+minuti[playerid];
    
prezzo[playerid] = prezzo1[playerid]/15;
    if(
VeicoloAffittato[playerid] > 1)
    {
        if(
Character[playerid][Bank] < prezzo[playerid]/2)
        {
            
TextDrawHideForPlayer(playeridTextdrawbike0);
            
TextDrawHideForPlayer(playeridTextdrawbike1);
            
PlayerTextDrawHide(playeridTextdrawbike2[playerid]);
            
PlayerTextDrawHide(playeridTextdrawbike3[playerid]);
            
format(stringsizeof(string), "Hai terminato i soldi sul conto in banca. Hai speso $%d."prezzo[playerid]*2);
            
SendClientMessage(playeridCOLOR_WHITEstring);
            
Character[playerid][Bank] -= prezzo[playerid]/2;
            
KillTimer(Lorenzo[playerid]);
            return 
1;
            }
        if(
ore[playerid] == && minuti[playerid] == && secondi[playerid] > 0)
        {
            
secondi[playerid]++;
            
format(strsizeof(str), "Tempo trascorso: %ds"secondi[playerid]);
            
PlayerTextDrawSetString(playerid,Textdrawbike2[playerid], str);
            
format(str1sizeof(str1), "Costo: %d$"prezzo[playerid]*2);
            
PlayerTextDrawSetString(playeridTextdrawbike3[playerid], str);
            return 
1;
            }
        else if(
secondi[playerid] == 60)
        {
            
secondi[playerid] = 0;
            
minuti[playerid] ++;
            
format(strsizeof(str), "Tempo trascorso: %dm %ds",minuti[playerid],secondi[playerid]);
            
PlayerTextDrawSetString(playeridTextdrawbike2[playerid], str);
            
format(str1sizeof(str1), "Costo: %d$"prezzo[playerid]*2);
            
PlayerTextDrawSetString(playeridTextdrawbike3[playerid], str);
            return 
1;
            }
        else if(
minuti[playerid] == 60)
        {
            
minuti[playerid] = 0;
            
ore[playerid]++;
            
format(strsizeof(str), "Tempo trascorso: %so %dm %ds"ore[playerid], minuti[playerid], secondi[playerid]);
            
PlayerTextDrawSetString(playeridTextdrawbike2[playerid], str);
            
format(str1sizeof(str1), "Costo: %d$"prezzo[playerid]*2);
            
PlayerTextDrawSetString(playeridTextdrawbike3[playerid], str);
            return 
1;
            }
        else if(
VeicoloAffittato[playerid] == 0)
        {
            
TextDrawHideForPlayer(playeridTextdrawbike0);
            
TextDrawHideForPlayer(playeridTextdrawbike1);
            
PlayerTextDrawHide(playeridTextdrawbike2[playerid]);
            
PlayerTextDrawHide(playeridTextdrawbike3[playerid]);
            
format(stringsizeof(string), "Hai terminato il noleggio. Hai speso $%d che ti sono stati addebitati sulla carta di credito."prezzo[playerid]*2);
            
SendClientMessage(playeridCOLOR_WHITEstring);
            
Character[playerid][Bank] -= prezzo[playerid]*2;
            
KillTimer(Lorenzo[playerid]);
            return 
1;
            }
        }
    return 
1;

Regarding your problem, where do you call the Callback InizioBici(playerid) ?
Reply


Messages In This Thread
Timer not starting - by alanhutch - 21.12.2017, 21:59
Re: Timer not starting - by RowdyrideR - 21.12.2017, 22:41
Re: Timer not starting - by alanhutch - 22.12.2017, 05:17
Re: Timer not starting - by RogueDrifter - 22.12.2017, 05:21
Re: Timer not starting - by alanhutch - 22.12.2017, 07:09
Re: Timer not starting - by RogueDrifter - 22.12.2017, 07:29
Re: Timer not starting - by alanhutch - 22.12.2017, 07:35
Re: Timer not starting - by RowdyrideR - 23.12.2017, 04:14
Re: Timer not starting - by alanhutch - 23.12.2017, 12:17

Forum Jump:


Users browsing this thread: 3 Guest(s)