//At the top of my script
forward TC(playerid);
new TrailerCheck[MAX_PLAYERS];
forward LUC(playerid);
new TTLevelUpCheck[MAX_PLAYERS];
//Initiating the timers by command
YCMD:confirmtruck(playerid, params[], help)
{
if(PlayerInfo[playerid][pJob] == 5)
{
new vehicle = GetPlayerVehicleID(playerid);
if(vehicle == 139 || vehicle == 138 || vehicle == 137)
{
TrailerCheck[playerid] = SetTimerEx("TrailerCheck",1000,true,"i",playerid);
TTLevelUpCheck[playerid] = SetTimerEx("TTLevelUpCheck",1000,true,"i",playerid);
PlayerInfo[playerid][pIsWorking] = 1;
Ccp[playerid] = 16;
SetPlayerCheckpoint(playerid,52.5144,-270.2235,1.6817,5.0);
SendClientMessage(playerid,COLOUR_ORANGE,"Pick up a load at the factory in Blue Berry Acres.");
TogglePlayerControllable(playerid,1);
}
else if(vehicle == 88 || vehicle == 87 || vehicle == 86)
{
TrailerCheck[playerid] = SetTimerEx("TrailerCheck",1000,true,"i",playerid);
TTLevelUpCheck[playerid] = SetTimerEx("TTLevelUpCheck",1000,true,"i",playerid);
PlayerInfo[playerid][pIsWorking] = 1;
Ccp[playerid] = 17;
SetPlayerCheckpoint(playerid,-1029.0247,-654.1725,32.0078, 5.0);
SendClientMessage(playerid,COLOUR_ORANGE,"Pick up your fuel at Red County Oil Processing.");
TogglePlayerControllable(playerid,1);
}
else if(vehicle == 85 || vehicle == 84 || vehicle == 83)
{
TrailerCheck[playerid] = SetTimerEx("TrailerCheck",1000,true,"i",playerid);
TTLevelUpCheck[playerid] = SetTimerEx("TTLevelUpCheck",1000,true,"i",playerid);
PlayerInfo[playerid][pIsWorking] = 1;
Ccp[playerid] = 18;
SetPlayerCheckpoint(playerid,2794.7849,-1602.4868,10.9287, 5.0);
SendClientMessage(playerid,COLOUR_ORANGE,"Pick up your surplus at the Sprunk Factory..");
TogglePlayerControllable(playerid,1);
}
else
{
SendClientMessage(playerid,COLOUR_RED,"Enter an available truck first!");
}
}
else
{
SendClientMessage(playerid,COLOUR_RED,"Truckers only!");
}
return 1;
}
//The bottom of my script
public TC(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
new trailerid = GetVehicleModel(GetVehicleTrailer(vehicleid));
if(IsPlayerInAnyVehicle(playerid))
{
if(IsTrailerAttachedToVehicle(vehicleid) == 1 && trailerid == 450)//dirttrucks
{
KillTimer(TrailerCheck[playerid]);
ShowPlayerDialog(playerid,42,DIALOG_STYLE_LIST,"Available Destinations","Blueberry to Flint County Farm\nBlueberry to the Cemetary\nBlueberry to the Stadium","Select","Cancel");
}
else if(IsTrailerAttachedToVehicle(vehicleid) == 1 && trailerid == 584)//fueltrucks
{
KillTimer(TrailerCheck[playerid]);
ShowPlayerDialog(playerid,43,DIALOG_STYLE_LIST,"Available Destinations","Red County to Flint County\nRed County to Vinewood\nRed County to Idlewood","Select","Cancel");
}
else if(IsTrailerAttachedToVehicle(vehicleid) == 1 && trailerid == 435)//surplustrucks
{
KillTimer(TrailerCheck[playerid]);
ShowPlayerDialog(playerid,44,DIALOG_STYLE_LIST,"Available Destinations","East Beach to Flint County\nEach Beach to Vinewood\nEast Beach to Idlewood","Select","Cancel");
}
}
return 1;
}
public LUC(playerid)
{
if(PlayerInfo[playerid][pJob] == 5)
{
if(PlayerInfo[playerid][pTTSoilLevel] == 3)
{
KillTimer(TTLevelUpCheck[playerid]);
PlayerInfo[playerid][pTTLevel] = 2;
SendClientMessage(playerid,COLOUR_ORANGE,"Your trucking level has increased, you can now use level 2 trucks!");
}
if(PlayerInfo[playerid][pTTFuelLevel] == 3)
{
KillTimer(TTLevelUpCheck[playerid]);
PlayerInfo[playerid][pTTLevel] = 3;
SendClientMessage(playerid,COLOUR_ORANGE,"Your trucking level has increased, you can now use level 3 trucks!");
}
if(PlayerInfo[playerid][pTTSurplusLevel] == 3)
{
KillTimer(TTLevelUpCheck[playerid]);
PlayerInfo[playerid][pTTLevel] += 1;
SendClientMessage(playerid,COLOUR_ORANGE,"Your trucking level has increased!");
}
}
return 1;
}
SetTimerEx("TrailerCheck" // blah blah
public TC(playerid)
// same thing for the LevelUp function as well.
new vehicle = GetPlayerVehicleID(playerid);
new vehicle = GetVehicleModel(GetPlayerVehicleID(playerid));
C:\Users\Devon\Desktop\Other\Servers\Devon's Roleplay\gamemodes\AAADevonsRoleplay.pwn(5725) : error 028: invalid subscript (not an array or too many subscripts): "TrailerCheck" C:\Users\Devon\Desktop\Other\Servers\Devon's Roleplay\gamemodes\AAADevonsRoleplay.pwn(5725) : warning 215: expression has no effect C:\Users\Devon\Desktop\Other\Servers\Devon's Roleplay\gamemodes\AAADevonsRoleplay.pwn(5725) : error 001: expected token: ";", but found "]" C:\Users\Devon\Desktop\Other\Servers\Devon's Roleplay\gamemodes\AAADevonsRoleplay.pwn(5725) : error 029: invalid expression, assumed zero C:\Users\Devon\Desktop\Other\Servers\Devon's Roleplay\gamemodes\AAADevonsRoleplay.pwn(5725) : fatal error 107: too many error messages on one line |