timers
#1

Error:
(207) : error 028: invalid subscript (not an array or too many subscripts): "onfoottime"
(207) : warning 215: expression has no effect
(207) : error 001: expected token: ";", but found "]"
(207) : error 029: invalid expression, assumed zero
(207) : fatal error 107: too many error messages on one line
pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
        new vehicle = GetPlayerVehicleID(playerid);
        if(newstate == PLAYER_STATE_ONFOOT && isRepairing[playerid] == 1)
        {
                new playerveh = GetPlayerVehicleID(playerid);
                SendClientMessage(playerid, COLOR_NEWS, "You left your service vehicle, you have 30 seconds to return to your vehicle");
                onfoottime[playerid] = SetTimerEx("FootLocks",1000,1,"i",playerid);
                onfoottime = 30; // 3 mins to repair locks.
                //KillTimer(locktimer[playerid]);
                TextDrawShowForPlayer(playerid,Textdraw4[playerid]);
                PutPlayerInVehicle(playerid, playerveh, 0);
                SetVehicleToRespawn(GetVehicleModel(playerveh));
        }
Reply
#2

pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
        new vehicle = GetPlayerVehicleID(playerid);
        if(newstate == PLAYER_STATE_ONFOOT && isRepairing[playerid] == 1)
        {
                new playerveh = GetPlayerVehicleID(playerid);
                SendClientMessage(playerid, COLOR_NEWS, "You left your service vehicle, you have 30 seconds to return to your vehicle");
                onfoottime[playerid] = SetTimerEx("FootLocks",18000,true,"i",playerid);//18000 ms is 3mins
                //you can set the time by using "=" as that will reasign the timersid!
                //KillTimer(locktimer[playerid]);
                TextDrawShowForPlayer(playerid,Textdraw4[playerid]);
                PutPlayerInVehicle(playerid, playerveh, 0);
                SetVehicleToRespawn(GetVehicleModel(playerveh));
        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)