What`s wrong here
#1

PHP код:
if(IsWorking[playerid] == && VJob[playerid] != -KillTimer(TimerStopJob); 
PHP код:
error 076syntax error in the expression, or invalid function call 
Reply
#2

you can't use -1, use VJob[playerid] < 0)

EDIT: you can
Reply
#3

That's not the reason. Show 10 lines before and 10 lines after.
Reply
#4

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    if(
PlayerData[playerid][SpectateP] != -1PlayerSpectateVehicle(PlayerData[playerid][SpectateP], vehicleid);
    if(
StaticVeh[vehicleid][vSpecial] == 15SendClientMessage(playeridRED"WARNING: This faggio will respawn in 10 seconds if you leave it.");
    if(
IsWorking[playerid] == && VJob[playerid] != -KillTimer(TimerStopJob);
    if(
PlayerData[playerid][CarLic] == && StaticVeh[vehicleid][vSpecial] == 0)
    if(
ispassenger ==0)
    {
        if(!(
IsAPlane(vehicleid) || IsABoat(vehicleid) || IsABike(vehicleid)))
            {
                if(
PlayerData[playerid][CarLic] == && StaticVeh[vehicleid][vSpecial] == 0)
                {
                new 
Float:xFloat:yFloat:z;
                
GetPlayerPos(playeridxyz);
                
SetPlayerPos(playeridxyz+3);
                
SendClientMessage(playeridCOLOR_WHITE"You don't have a driving license");
                }
                if(
PlayerData[playerid][CarLic] == && StaticVeh[vehicleid][vSpecial] == 15)
                {
                new 
Float:xFloat:yFloat:z;
                
GetPlayerPos(playeridxyz);
                
SetPlayerPos(playeridxyz+3);
                
SendClientMessage(playeridCOLOR_WHITE"You don't have a driving license");
                }
            }
    } 
Reply
#5

you have missing brackets after this - if(PlayerData[playerid][CarLic] == 0 && StaticVeh[vehicleid][vSpecial] == 0)

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger

    if(
PlayerData[playerid][SpectateP] != -1PlayerSpectateVehicle(PlayerData[playerid][SpectateP], vehicleid); 
    if(
StaticVeh[vehicleid][vSpecial] == 15SendClientMessage(playeridRED"WARNING: This faggio will respawn in 10 seconds if you leave it."); 
    if(
IsWorking[playerid] == && VJob[playerid] != -KillTimer(TimerStopJob); 
    if(
PlayerData[playerid][CarLic] == && StaticVeh[vehicleid][vSpecial] == 0)
    {
        if(
ispassenger ==0
        { 
            if(!
IsAPlane(vehicleid)  && !IsABoat(vehicleid) && !IsABike(vehicleid)) 
            { 
                if(
PlayerData[playerid][CarLic] == && StaticVeh[vehicleid][vSpecial] == 0
                { 
                    new 
Float:xFloat:yFloat:z
                    
GetPlayerPos(playeridxyz); 
                    
SetPlayerPos(playeridxyz+3); 
                    
SendClientMessage(playeridCOLOR_WHITE"You don't have a driving license"); 
                } 
                if(
PlayerData[playerid][CarLic] == && StaticVeh[vehicleid][vSpecial] == 15
                { 
                    new 
Float:xFloat:yFloat:z
                    
GetPlayerPos(playeridxyz); 
                    
SetPlayerPos(playeridxyz+3); 
                    
SendClientMessage(playeridCOLOR_WHITE"You don't have a driving license"); 
                } 
            } 
        }
    }

Reply
#6

i dont think it`s that becasue if i delete this line
PHP код:
if(IsWorking[playerid] == && VJob[playerid] != -KillTimer(TimerStopJob); 
it works with no errors
Reply
#7

okay, can u show me this timer? TimerStopJob
Reply
#8

PHP код:
function TimerStopJob(playerid)
{
    if(
VJob[playerid] != -1) { DestroyVehicle(VJob[playerid]); VJob[playerid] = 0; }
    if(
TrailerID[playerid] != -1) { DestroyVehicle(TrailerID[playerid]); TrailerID[playerid] = 0; }
    
DisablePlayerCheckpoint(playerid);
    
RemoveDestination(playerid);
    
PTruckerCP[playerid] = -1;
    
VJob[playerid] = -1;
    
TrailerID[playerid] = -1;
    
IsWorking[playerid] =0;
    
SendClientMessage(playeridCOLOR_WHITE"You canceled your job");
    return 
1;

PHP код:
SetTimerEx("TimerStopJob"300000"i"playerid); 
Reply
#9

you have to create a separate variable for this timer.
for example TimerStopJobTimer[MAX_PLAYERS];
than you have to start a timer like this.
TimerStopJobTimer[playerid] = SetTimerEx("TimerStopJob", 30000, 0, "i", playerid);
and kill must be this
KillTimer(TimerStopJobTimer[playerid]);
Reply
#10

Quote:
Originally Posted by Mugalito
Посмотреть сообщение
you have to create a separate variable for this timer.
for example TimerStopJobTimer[MAX_PLAYERS];
than you have to start a timer like this.
TimerStopJobTimer[playerid] = SetTimerEx("TimerStopJob", 30000, 0, "i", playerid);
and kill must be this
KillTimer(TimerStopJobTimer[playerid]);
i did it exactly like this and it worked ,i thought about this.thanks anyways brother !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)