Making requicktmens to join a job
#1

hello ,
who can help me to make for a job in FS , to make for it some requicktmens to enter this job , like level 3 needed and a valid Licenses (licesense without taking test Etc .. just a command and that licenses cost 100K)

here is the FS

i appreciate who can help me on that , thanks !

PHP код:
/*
This TruckMission FilterScript is made by =>Sandra<= on the 10th of March 2008
Do not remove any credits!
*/
#include <a_samp>
#include <dini>
#define MAX_MISSIONS 25
#define MissionFile "Truckmissions/%d.mission"
#define DefaultCheckpointSize 5
#define DefaultTruckModel 515
#define DefaultTrailerModel 435
#define DefaultPrize 1000
//Colors
#define COLOR_RED 0xFF0000AA
#define COLOR_GREEN 0x00FF00AA
#define COLOR_BLUE 0x0000FFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_ORANGE 0xFFA500AA
#define COLOR_MENU 0xADFF2FAA //Green/Yellow
#define COLOR_MENUHEADER 0x7CFC00AA
#define COLOR_AQUA 0x66CDAAAA
//Actions
#define CHANGE_NAME 1
#define CHANGE_PRIZE 2
#define CHANGE_MODEL 3
#define CHANGE_CPSIZE 4
#define CHANGE_TRAILER 5
#define CHANGE_COLOR1 6
#define CHANGE_COLOR2 7
#define CHANGE_TIMELIMIT 8
/*
===============Usable Truck & Trailer Models:
Truck-Models:
403 - Linerunner
514 - Petrol Tanker
515 - RoadTrain
Trailer-Models:
435 - Trailer 1
450 - Trailer 2
591 - Trailer 3
584 - PetrolTrailer
=============================================
*/
enum Minfo
{
    
Ready,
    
DoesExists,
    
Float:StartX,
    
Float:StartY,
    
Float:StartZ,
    
Float:StartAngle,
    
Float:EndX,
    
Float:EndY,
    
Float:EndZ,
    
CpSize,
    
Prize,
    
Name[50],
    
TruckModel,
    
TruckColor1,
    
TruckColor2,
    
Highscore,
    
HighscoreName[MAX_PLAYER_NAME],
    
IsGettingPlayed,
    
TickcountBeforeStart,
    
TrailerModel,
    
UseTrailer,
    
TimeLimit,
    
Timer,
}
new 
MissionInfo[MAX_MISSIONS][Minfo];
new 
VehNames[212][] =
{
   
"Landstalker""Bravura",   "Buffalo",   "Linerunner",   "Pereniel",   "Sentinel",   "Dumper",   "Firetruck",   "Trashmaster",   "Stretch",
   
"Manana",   "Infernus",   "Voodoo",   "Pony",   "Mule",   "Cheetah",   "Ambulance",   "Leviathan",   "Moonbeam",   "Esperanto",   "Taxi",
   
"Washington",   "Bobcat",   "Mr Whoopee",   "BF Injection",   "Hunter",   "Premier",   "Enforcer",   "Securicar",   "Banshee",   "Predator",
   
"Bus",   "Rhino",   "Barracks",   "Hotknife",   "Trailer",   "Previon",   "Coach",   "Cabbie",   "Stallion",   "Rumpo",   "RC Bandit",  "Romero",
   
"Packer",   "Monster",   "Admiral",   "Squalo",   "Seasparrow",   "Pizzaboy",   "Tram",   "Trailer",   "Turismo",   "Speeder",   "Reefer",   "Tropic",   "Flatbed",
   
"Yankee",   "Caddy",   "Solair",   "Berkley's RC Van",   "Skimmer",   "PCJ-600",   "Faggio",   "Freeway",   "RC Baron",   "RC Raider",
   
"Glendale",   "Oceanic",   "Sanchez",   "Sparrow",   "Patriot",   "Quad",   "Coastguard",   "Dinghy",   "Hermes",   "Sabre",   "Rustler",
   
"ZR3 50",   "Walton",   "Regina",   "Comet",   "BMX",   "Burrito",   "Camper",   "Marquis",   "Baggage",   "Dozer",   "Maverick",   "News Chopper",
   
"Rancher",   "FBI Rancher",   "Virgo",   "Greenwood",   "Jetmax",   "Hotring",   "Sandking",   "Blista Compact",   "Police Maverick",
   
"Boxville",   "Benson",   "Mesa",   "RC Goblin",   "Hotring Racer",   "Hotring Racer",   "Bloodring Banger",   "Rancher",   "Super GT",
   
"Elegant",   "Journey",   "Bike",   "Mountain Bike",   "Beagle",   "Cropdust",   "Stunt",   "Tanker",   "RoadTrain",   "Nebula",   "Majestic",
   
"Buccaneer",   "Shamal",   "Hydra",   "FCR-900",   "NRG-500",   "HPV1000",   "Cement Truck",   "Tow Truck",   "Fortune",   "Cadrona",   "FBI Truck",
   
"Willard",   "Forklift",   "Tractor",   "Combine",   "Feltzer",   "Remington",   "Slamvan",   "Blade",   "Freight",   "Streak",   "Vortex",   "Vincent",
   
"Bullet",   "Clover",   "Sadler",   "Firetruck",   "Hustler",   "Intruder",   "Primo",   "Cargobob",   "Tampa",   "Sunrise",   "Merit",   "Utility",
   
"Nevada",   "Yosemite",   "Windsor",   "Monster",   "Monster",   "Uranus",   "Jester",   "Sultan",   "Stratum",   "Elegy",   "Raindance",   "RC Tiger",
   
"Flash",   "Tahoma",   "Savanna",   "Bandito",   "Freight",   "Trailer",   "Kart",   "Mower",   "Duneride",   "Sweeper",   "Broadway",
   
"Tornado",   "AT-400",   "DFT-30",   "Huntley",   "Stafford",   "BF-400",   "Newsvan",   "Tug",   "Trailer",   "Emperor",   "Wayfarer",
   
"Euros",   "Hotdog",   "Club",   "Trailer",   "Trailer",   "Andromada",   "Dodo",   "RC Cam",   "Launch",   "Police Car (LSPD)",   "Police Car (SFPD)",
   
"Police Car (LVPD)",   "Police Ranger",   "Picador",   "S.W.A.T. Van",   "Alpha",   "Phoenix",   "Glendale",   "Sadler",   "Luggage Trailer",
   
"Luggage Trailer",   "Stair Trailer",   "Boxville",   "Farm Plow",   "Utility Trailer"
};
new 
TruckmissionPlaying[MAX_PLAYERS];
new 
FileName[60];
new 
Question;
new 
Menu:SettingsMenu1;
new 
Menu:SettingsMenu2;
new 
Menu:UseTrailerMenu;
new 
Menu:ColorMenu;
new 
SpecialAction[MAX_PLAYERS];
new 
EditMissionID;
new 
Truck[MAX_MISSIONS];
new 
Trailer[MAX_MISSIONS];
public 
OnFilterScriptInit()
{
    for(new 
i=1i<MAX_MISSIONSi++)
    {
        
format(MissionInfo[i][HighscoreName], MAX_PLAYER_NAME"Nobody");
        
format(FileNamesizeof(FileName), MissionFilei);
        if(
dini_Exists(FileName))
        {
            
MissionInfo[i][DoesExists] = 1;
            
ReadFile(i);
        }
    }
    
SettingsMenu1 CreateMenu("Settings"115015030040);
    
AddMenuItem(SettingsMenu10"Change Name");
    
AddMenuItem(SettingsMenu10"Set StartPosition");
    
AddMenuItem(SettingsMenu10"Set Finishposition");
    
AddMenuItem(SettingsMenu10"Change Checkpointsize");
    
AddMenuItem(SettingsMenu10"Change Prize");
    
AddMenuItem(SettingsMenu10"Change Truckmodel");
    
AddMenuItem(SettingsMenu10"Reset Highscore");
    
AddMenuItem(SettingsMenu10"View MissionInfo");
    
AddMenuItem(SettingsMenu10"Reload Mission");
    
AddMenuItem(SettingsMenu10"Next");
    
SettingsMenu2 CreateMenu("Settings"115015030040);
    
AddMenuItem(SettingsMenu20"Use Trailer");
    
AddMenuItem(SettingsMenu20"Change Trailermodel");
    
AddMenuItem(SettingsMenu20"Change Truckcolor");
    
AddMenuItem(SettingsMenu20"Set TimeLimit");
    
AddMenuItem(SettingsMenu20"Back");
    
UseTrailerMenu CreateMenu(" "115015030040);
    
SetMenuColumnHeader(UseTrailerMenu0"Do you want to use a trailer?");
    
AddMenuItem(UseTrailerMenu0"Yes");
    
AddMenuItem(UseTrailerMenu0"No");
    
AddMenuItem(UseTrailerMenu0"Back");
    
ColorMenu CreateMenu("Colors"115015030040);
    
AddMenuItem(ColorMenu0"Change Color 1");
    
AddMenuItem(ColorMenu0"Change Color 2");
    
AddMenuItem(ColorMenu0"Show Color ID's");
    
AddMenuItem(ColorMenu0"Back");
    print(
"==========================================");
    print(
"This Truckmission Filterscript is made by:");
    print(
"                =>Sandra<=                ");
    print(
"        Do not remove the credits!        ");
    print(
"==========================================");
    return 
1;
}
public 
OnFilterScriptExit()
{
    
SaveFiles();
    for(new 
ii<MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            for(new 
ID=1ID<MAX_MISSIONSID++)
            {
                if(
IsPlayerInVehicle(iTruck[ID]))
                {
                    
RemovePlayerFromVehicle(i);
                }
            }
        }
    }
    for(new 
ID=1ID<MAX_MISSIONSID++)
    {
           
DestroyVehicle(Truck[ID]);
           
DestroyVehicle(Trailer[ID]);
    }
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
TruckmissionPlaying[playerid] = 0;
    
SpecialAction[playerid] = 0;
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    new 
ID TruckmissionPlaying[playerid];
    if(
ID 0)
    {
        
MissionInfo[ID][IsGettingPlayed] = 0;
         
MissionInfo[ID][TickcountBeforeStart] = 0;
         
DisablePlayerCheckpoint(playerid);
        
SetVehicleToRespawn(Truck[ID]);
        
SetVehicleToRespawn(Trailer[ID]);
        
KillTimer(MissionInfo[ID][Timer]);
        if(
MissionInfo[ID][UseTrailer] == 1)
        {
            
DestroyVehicle(Trailer[ID]);
        }
    }
    
TruckmissionPlaying[playerid] = 0;
    return 
1;
}
public 
OnVehicleDeath(vehicleidkillerid)
{
    new 
PTruck;
    for(new 
ID=1ID<MAX_MISSIONSID++)
    {
        if(
Truck[ID] == vehicleid)
        {
            
PTruck ID;
            break;
        }
    }
    if(
PTruck 0)
    {
        for(new 
ii<MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                if(
TruckmissionPlaying[i] == PTruck)
                {
                    
GameTextForPlayer(i"~r~Loser"50003);
                    
TruckmissionPlaying[i] = 0;
                    
MissionInfo[PTruck][IsGettingPlayed] = 0;
                     
MissionInfo[PTruck][TickcountBeforeStart] = 0;
                     
DisablePlayerCheckpoint(i);
                     
SendClientMessage(iCOLOR_RED"You failed the Truckmission!");
                    
SetVehicleToRespawn(Truck[PTruck]);
                    
TruckmissionPlaying[i] = 0;
                    if(
MissionInfo[PTruck][UseTrailer] == 1)
                    {
                        
DestroyVehicle(Trailer[PTruck]);
                    }
                }
            }
        }
    }
    return 
1;
}
public 
OnPlayerText(playeridtext[])
{
    if(
SpecialAction[playerid] > 0)
    {
        switch(
SpecialAction[playerid])
        {
            case 
CHANGE_NAME:
            {
                new 
string[128];
                
format(MissionInfo[EditMissionID][Name], 50"%s"text);
                
format(stringsizeof(string), "The new name of TruckMission #%d is: \"%s\"."EditMissionIDMissionInfo[EditMissionID][Name]);
                
SendClientMessage(playeridCOLOR_GREENstring);
                
GameTextForPlayer(playerid" "1003);
                
ShowMenuForPlayer(SettingsMenu1playerid);
                
SpecialAction[playerid] = 0;
                return 
0;
            }
            case 
CHANGE_PRIZE:
            {
                if(!
IsNumeric(text))
                {
                    
SendClientMessage(playeridCOLOR_RED"Only numbers allowed!");
                    return 
0;
                }
                else
                {
                    new 
newval strval(text);
                    new 
string[128];
                    
MissionInfo[EditMissionID][Prize] = newval;
                    
format(stringsizeof(string), "The new prize of TruckMission #%d is: $%d"EditMissionIDMissionInfo[EditMissionID][Prize]);
                    
SendClientMessage(playeridCOLOR_GREENstring);
                    
GameTextForPlayer(playerid" "1003);
                    
ShowMenuForPlayer(SettingsMenu1playerid);
                    
SpecialAction[playerid] = 0;
                }
                return 
0;
            }
            case 
CHANGE_CPSIZE:
            {
                if(!
IsNumeric(text))
                {
                    
SendClientMessage(playeridCOLOR_RED"Only numbers allowed!");
                    return 
0;
                }
                else
                {
                    new 
newval strval(text);
                    new 
string[128];
                    
MissionInfo[EditMissionID][CpSize] = newval;
                    
format(stringsizeof(string), "The new CheckpointSize of TruckMission #%d is: %d"EditMissionIDMissionInfo[EditMissionID][CpSize]);
                    
SendClientMessage(playeridCOLOR_GREENstring);
                    
GameTextForPlayer(playerid" "1003);
                    
ShowMenuForPlayer(SettingsMenu1playerid);
                    
SpecialAction[playerid] = 0;
                    return 
0;
                }
            }
            case 
CHANGE_MODEL:
            {
                if(!
IsNumeric(text))
                {
                    
SendClientMessage(playeridCOLOR_RED"Only numbers allowed!");
                    return 
0;
                }
                if(!
IsUsableTruck(strval(text)))
                {
                    
SendClientMessage(playeridCOLOR_RED"Invalid Model. (Available: 403, 514, 515)");
                    return 
0;
                }
                else
                {
                    new 
newval strval(text);
                    new 
string[128];
                    
MissionInfo[EditMissionID][TruckModel] = newval;
                    
format(stringsizeof(string), "The new Truckmodel of TruckMission #%d is: %d (%s)"EditMissionIDMissionInfo[EditMissionID][TruckModel], VehNames[newval-400]);
                    
SendClientMessage(playeridCOLOR_GREENstring);
                    
GameTextForPlayer(playerid" "1003);
                    
ShowMenuForPlayer(SettingsMenu1playerid);
                    
SpecialAction[playerid] = 0;
                    return 
0;
                }
               }
               case 
CHANGE_TRAILER:
            {
                if(!
IsNumeric(text))
                {
                    
SendClientMessage(playeridCOLOR_RED"Only numbers allowed!");
                    return 
0;
                }
                if(!
IsUsableTrailer(strval(text)))
                {
                    
SendClientMessage(playeridCOLOR_RED"Invalid Model. (Available: 435, 450, 584, 591)");
                    return 
0;
                }
                else
                {
                    new 
newval strval(text);
                    new 
string[128];
                    
MissionInfo[EditMissionID][TrailerModel] = newval;
                    
format(stringsizeof(string), "The new TrailerModel of TruckMission #%d is: %d (%s)"EditMissionIDMissionInfo[EditMissionID][TrailerModel], VehNames[newval-400]);
                    
SendClientMessage(playeridCOLOR_GREENstring);
                    
GameTextForPlayer(playerid" "1003);
                    
ShowMenuForPlayer(SettingsMenu2playerid);
                    
SpecialAction[playerid] = 0;
                    return 
0;
                }
               }
               case 
CHANGE_COLOR1:
            {
                if(!
IsNumeric(text))
                {
                    
SendClientMessage(playeridCOLOR_RED"Only numbers allowed!");
                    return 
0;
                }
                else
                {
                    new 
newval strval(text);
                    if(
newval < -|| newval 126)
                    {
                        
SendClientMessage(playeridCOLOR_RED"Pick a number between -1 and 126!");
                        return 
0;
                    }
                    new 
string[128];
                    
MissionInfo[EditMissionID][TruckColor1] = newval;
                    
format(stringsizeof(string), "The new Truckcolor1 of TruckMission #%d is: %d"EditMissionIDMissionInfo[EditMissionID][TruckColor1]);
                    
SendClientMessage(playeridCOLOR_GREENstring);
                    
GameTextForPlayer(playerid" "1003);
                    
ShowMenuForPlayer(SettingsMenu2playerid);
                    
SpecialAction[playerid] = 0;
                    return 
0;
                }
               }
               case 
CHANGE_COLOR2:
            {
                if(!
IsNumeric(text))
                {
                    
SendClientMessage(playeridCOLOR_RED"Only numbers allowed!");
                    return 
0;
                }
                else
                {
                    new 
newval strval(text);
                    if(
newval < -|| newval 126)
                    {
                        
SendClientMessage(playeridCOLOR_RED"Pick a number between -1 and 126!");
                        return 
0;
                    }
                    new 
string[128];
                    
MissionInfo[EditMissionID][TruckColor2] = newval;
                    
format(stringsizeof(string), "The new Truckcolor2 of TruckMission #%d is: %d"EditMissionIDMissionInfo[EditMissionID][TruckColor2]);
                    
SendClientMessage(playeridCOLOR_GREENstring);
                    
GameTextForPlayer(playerid" "1003);
                    
ShowMenuForPlayer(SettingsMenu2playerid);
                    
SpecialAction[playerid] = 0;
                    return 
0;
                }
               }
               case 
CHANGE_TIMELIMIT:
            {
                if(!
IsNumeric(text))
                {
                    
SendClientMessage(playeridCOLOR_RED"Only numbers allowed!");
                    return 
0;
                }
                else
                {
                    new 
newval strval(text);
                    if(
newval 0)
                    {
                        
SendClientMessage(playeridCOLOR_RED"You can't set a negative number!");
                        return 
0;
                    }
                    new 
string[128];
                    
MissionInfo[EditMissionID][TimeLimit] = newval;
                    
format(stringsizeof(string), "The new timelimit of TruckMission #%d is %d seconds"EditMissionIDMissionInfo[EditMissionID][TimeLimit]);
                    
SendClientMessage(playeridCOLOR_GREENstring);
                    
GameTextForPlayer(playerid" "1003);
                    
ShowMenuForPlayer(SettingsMenu2playerid);
                    
SpecialAction[playerid] = 0;
                    return 
0;
                }
               }
        }
    }
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    new 
cmd[256], tmp[256], idx;
    
cmd strtok(cmdtextidx);
    
    if (
strcmp("/createmission"cmdtexttrue) == 0)
    {
        new 
NewID;
        if(!
IsPlayerAdmin(playerid)) return 0;
        for(new 
i=1i<MAX_MISSIONSi++)
        {
            if(
MissionInfo[i][DoesExists] == 0)
            {
                
NewID i;
                new 
string[128];
                
format(stringsizeof(string), "The ID of this new Truckmission is: %d.  Use: \"/editmission %d\" to edit this mission."NewIDNewID);
                
SendClientMessage(playeridCOLOR_YELLOWstring);
                
MissionInfo[NewID][DoesExists] = 1;
                
CreateNewFile(NewID);
                break;
            }
        }
        if(
NewID == 0)
        {
            
SendClientMessage(playeridCOLOR_RED"Limit of Truckmissions reached! You can increase this limit in the .pwn file!");
        }
        return 
1;
    }
    
     if(
strcmp(cmd"/deletemission"true) == 0)
    {
        if(!
IsPlayerAdmin(playerid)) return 0;
        new 
string[128];
           
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playerid,COLOR_RED"Use: /deletemission [MissionID]");
            return 
1;
        }
        new 
ID strval(tmp);
        if(
MissionInfo[ID][DoesExists] == 1)
        {
            
format(FileNamesizeof(FileName), MissionFileID);
            
dini_Remove(FileName);
            
MissionInfo[ID][DoesExists] = 0;
            
format(stringsizeof(string), "You deleted Truckmission #%d."ID);
            
SendClientMessage(playeridCOLOR_ORANGEstring);
            
DestroyVehicle(Truck[ID]);
            
DestroyVehicle(Trailer[ID]);
        }
        else
        {
            
format(stringsizeof(string), "Truckmission #%d does not exists!"ID);
            
SendClientMessage(playeridCOLOR_REDstring);
        }
        return 
1;
    }
    
     if(
strcmp(cmd"/editmission"true) == 0)
    {
        if(!
IsPlayerAdmin(playerid)) return 0;
        new 
string[128];
           
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playerid,COLOR_RED"Use: /editmission [MissionID]");
            return 
1;
        }
        new 
ID strval(tmp);
        if(
MissionInfo[ID][DoesExists] == 1)
        {
            
format(stringsizeof(string), "Settings for Truckmission #%d."ID);
            
SetMenuColumnHeader(SettingsMenu10string);
            
ShowMenuForPlayer(SettingsMenu1playerid);
            
TogglePlayerControllable(playerid0);
            
EditMissionID ID;
        }
        else
        {
            
format(stringsizeof(string), "Truckmission #%d does not exists!"ID);
            
SendClientMessage(playeridCOLOR_REDstring);
        }
        return 
1;
    }
    
    if(
strcmp(cmd"/missioninfo"true) == 0)
    {
        if(!
IsPlayerAdmin(playerid)) return 0;
        new 
string[128];
           
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playerid,COLOR_RED"Use: /missioninfo [MissionID]");
            return 
1;
        }
        new 
ID strval(tmp);
        if(
MissionInfo[ID][DoesExists] == 1)
        {
            
GetMissionInfo(playeridID);
            return 
1;
        }
        else
        {
            
format(stringsizeof(string), "Truckmission #%d does not exists!"ID);
            
SendClientMessage(playeridCOLOR_REDstring);
        }
        return 
1;
    }
    if(
strcmp(cmdtext"/yes"true)==0)
    {
        if(!
IsPlayerAdmin(playerid)) return 0;
        if(
Question == 0)
        {
            
SendClientMessage(playeridCOLOR_RED"There is no question for you at the moment.");
            return 
1;
        }
        if(
Question == 1)
        {
              if(
IsPlayerInAnyVehicle(playerid))
            {
                
GetVehiclePos(GetPlayerVehicleID(playerid), MissionInfo[EditMissionID][StartX], MissionInfo[EditMissionID][StartY], MissionInfo[EditMissionID][StartZ]);
                
GetVehicleZAngle(GetPlayerVehicleID(playerid), MissionInfo[EditMissionID][StartAngle]);
            }
            else
            {
                
GetPlayerPos(playeridMissionInfo[EditMissionID][StartX], MissionInfo[EditMissionID][StartY], MissionInfo[EditMissionID][StartZ]);
                
GetPlayerFacingAngle(playeridMissionInfo[EditMissionID][StartAngle]);
            }
            
GameTextForPlayer(playerid"~g~New StartPosition Saved!"40004);
            
Question 0;
            
ShowMenuForPlayer(SettingsMenu1playerid);
            return 
1;
        }
        if(
Question == 2)
        {
            
GetPlayerPos(playeridMissionInfo[EditMissionID][EndX], MissionInfo[EditMissionID][EndY], MissionInfo[EditMissionID][EndZ]);
            
GameTextForPlayer(playerid"~g~New FinishPosition Saved!"40004);
            
Question 0;
            
ShowMenuForPlayer(SettingsMenu1playerid);
            return 
1;
        }
    }
    
    if(
strcmp(cmdtext"/no"true)==0)
    {
        if(!
IsPlayerAdmin(playerid)) return 0;
        if(
Question == 0)
        {
            
SendClientMessage(playeridCOLOR_RED"There is no question for you at the moment.");
            return 
1;
        }
        else
        {
            
GameTextForPlayer(playerid" "1003);
            
ShowMenuForPlayer(SettingsMenu1playerid);
        }
        return 
1;
    }
    
    if(
strcmp(cmd"/startmission"true)==0)
    {
        if(
TruckmissionPlaying[playerid] > 0) return SendClientMessage(playeridCOLOR_RED"You are already playing a Truckmission!");
        new 
IsInATruck;
        new 
ID;
        for(new 
i=1i<MAX_MISSIONSi++)
        {
            if(
IsPlayerInVehicle(playeridTruck[i]))
            {
                
ID i;
                
IsInATruck 1;
                break;
            }
        }
        if(
IsInATruck == 0) return SendClientMessage(playeridCOLOR_RED"You are not inside a Mission-Truck!");
        new 
string[128];
        if(!
IsMissionReady(ID))
        {
            
SendClientMessage(playeridCOLOR_RED"This mission is not ready yet!");
            return 
1;
        }
        if(
MissionInfo[ID][IsGettingPlayed] == 0)
        {
            
MissionInfo[ID][IsGettingPlayed] = 1;
            
TruckmissionPlaying[playerid] = ID;
            if(
MissionInfo[ID][UseTrailer] == 1)
            {
                
Trailer[ID] = CreateVehicle(MissionInfo[ID][TrailerModel], 0000, -1, -1, -1);//CreateVehicle(435, 1614.4490,-1825.0944,13.5061, 82.2873, 0, 1, 60);
                
AttachTrailerToVehicle(Trailer[ID], Truck[ID]);
            }
            if(
MissionInfo[ID][TimeLimit] > 0)
            {
                
MissionInfo[ID][Timer] = SetTimerEx("MissionTimer", (MissionInfo[ID][TimeLimit]*1000), 0"id"playeridID);
                
format(stringsizeof(string), "Take this truck to the checkpoint within %d seconds!"MissionInfo[ID][TimeLimit]);
                
SendClientMessage(playeridCOLOR_AQUAstring);
            }
            else
            {
                
SendClientMessage(playeridCOLOR_AQUA"Take this Truck to the checkpoint marked on the radar as fast as you can!");
            }
            
TogglePlayerControllable(playerid1);
            
MissionInfo[ID][TickcountBeforeStart] = GetTickCount();
            
            
SetPlayerCheckpoint(playeridMissionInfo[ID][EndX], MissionInfo[ID][EndY], MissionInfo[ID][EndZ], MissionInfo[ID][CpSize]);
        }
        else
        {
            
format(stringsizeof(string), "Sorry, someone else is already playing Truckmission #%d"ID);
            
SendClientMessage(playeridCOLOR_REDstring);
        }
        return 
1;
    }
    
    if(
strcmp(cmd"/stopmission"true)==0)
    {
        if(
TruckmissionPlaying[playerid] == 0) return SendClientMessage(playeridCOLOR_RED"You are not playing a Truckmission!");
        
RemovePlayerFromVehicle(playerid);
        new 
ID TruckmissionPlaying[playerid];
        
TruckmissionPlaying[playerid] = 0;
        
MissionInfo[ID][IsGettingPlayed] = 0;
         
MissionInfo[ID][TickcountBeforeStart] = 0;
         
DisablePlayerCheckpoint(playerid);
         
SendClientMessage(playeridCOLOR_AQUA"You stopped your current Truckmission!");
        
SetVehicleToRespawn(Truck[ID]);
        
KillTimer(MissionInfo[ID][Timer]);
        if(
MissionInfo[ID][UseTrailer] == 1)
        {
            
DestroyVehicle(Trailer[ID]);
        }
        return 
1;
    }
    if(
strcmp(cmdtext"/exit"true)==0)
    {
        
TogglePlayerControllable(playerid1);
        
RemovePlayerFromVehicle(playerid);
        return 
1;
    }
    
    if(
strcmp(cmdtext"/truckmissions"true)==0)
    {
        new 
string[128];
        new 
count;
        new 
busy[5];
        
SendClientMessage(playeridCOLOR_MENUHEADER"=======Available Truckmissions:=========");
        for(new 
i=1i<MAX_MISSIONSi++)
        {
            if(
MissionInfo[i][DoesExists] == 1)
            {
                if(
MissionInfo[i][IsGettingPlayed] == 1busy "Busy";
                if(
MissionInfo[i][IsGettingPlayed] == 0busy "Free";
                
format(stringsizeof(string), "#%d = \"%s\"   %s"iMissionInfo[i][Name], busy);
                
SendClientMessage(playeridCOLOR_MENUstring);
                
count++;
            }
         }
        if(
count 9)
        {
            
SendClientMessage(playeridCOLOR_ORANGE"Use PageUp and PageDown to scroll through te chat");
        }
        return 
1;
    }
    if(
strcmp(cmdtext"/truckmodels"true)==0)
    {
        if(!
IsPlayerAdmin(playerid)) return 0;
        
SendClientMessage(playeridCOLOR_MENUHEADER"=====Available Truck- & Trailermodels:=====");
        
SendClientMessage(playeridCOLOR_MENU"Trucks: 403, 514, 515");
        
SendClientMessage(playeridCOLOR_MENU"Trailers: 435, 450, 584, 591");
        
SendClientMessage(playeridCOLOR_MENUHEADER"===========================================");
        return 
1;
    }
    
    if(
strcmp(cmdtext"/truckhelp"true)==0)
    {
        
SendClientMessage(playeridCOLOR_MENUHEADER"=============Available Commands:==========");
        
SendClientMessage(playeridCOLOR_MENU"/startmission, /exit, /stopmission, /truckmissions");
        if(
IsPlayerAdmin(playerid))
        {
            
SendClientMessage(playeridCOLOR_MENUHEADER"AdminCommands:");
            
SendClientMessage(playeridCOLOR_MENU"/createmission, /deletemission <id>");
            
SendClientMessage(playeridCOLOR_MENU"/editmission <id>, /missioninfo <id>");
            
SendClientMessage(playeridCOLOR_MENU"/missionteleport <id>, /truckmodels");
        }
        return 
1;
    }
    
    if(
strcmp(cmd"/missionteleport"true) == 0)
    {
        if(!
IsPlayerAdmin(playerid)) return 0;
        new 
string[128];
           
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playerid,COLOR_RED"Use: /missionteleport [MissionID]");
            return 
1;
        }
        new 
ID strval(tmp);
        if(
MissionInfo[ID][DoesExists] == 1)
        {
            
SetPlayerPos(playeridMissionInfo[ID][StartX], MissionInfo[ID][StartY], (MissionInfo[ID][StartZ]+4));
            return 
1;
        }
        else
        {
            
format(stringsizeof(string), "Truckmission #%d does not exists!"ID);
            
SendClientMessage(playeridCOLOR_REDstring);
        }
        return 
1;
    }
    if(
strcmp(cmd"/c"true) == 0)
    {
        if(!
IsPlayerAdmin(playerid)) return 0;
         new 
Float:x,Float:y,Float:zFloat:a;
           
tmp strtok(cmdtextidx);
           new 
vid strval(tmp);
           if(
vid 400 || vid 609)
           {
               
SendClientMessage(playerid,COLOR_RED,"Gebruik: /car [400-609]");
               return 
1;
           }
           else
        {
               
GetPlayerPos(playeridxyz);
               
GetPlayerFacingAngle(playerida);
               new 
newcar CreateVehicle(vid,xyza, -1, -1240000);
               
PutPlayerInVehicle(playeridnewcar0);
        }
         return 
1;
    }
    return 
0;
}
public 
OnPlayerExitVehicle(playeridvehicleid)
{
    new 
PTruck;
    for(new 
ID=1ID<MAX_MISSIONSID++)
    {
        if(
IsPlayerInVehicle(playeridTruck[ID]))
        {
            
PTruck ID;
            break;
        }
    }
    if(
PTruck 0)
    {
        
SendClientMessage(playeridCOLOR_RED"You have 10 seconds to get back in your truck, or else the mission will be over!");
        
SetTimerEx("ExitedTruck"100000"id"playeridPTruck);
    }
        
    return 
1;
}
public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == 2)
    {
        if(
TruckmissionPlaying[playerid] == 0)
        {
            new 
PTruck;
            for(new 
ID=1ID<MAX_MISSIONSID++)
            {
                if(
IsPlayerInVehicle(playeridTruck[ID]))
                {
                    
PTruck ID;
                    break;
                }
            }
            if(
PTruck 0)
            {
                
TogglePlayerControllable(playerid0);
                new 
string[128];
                
format(stringsizeof(string), "With this truck you can play Truckmission #%d"PTruck);
                
SendClientMessage(playeridCOLOR_ORANGEstring);
                
SendClientMessage(playeridCOLOR_ORANGE"Typ /startmission or else /exit");
            }
        }
    }
    return 
1;
}
forward ExitedTruck(playeridID);
public 
ExitedTruck(playeridID)
{
    if(!
IsPlayerInVehicle(playeridTruck[ID]))
    {
        
GameTextForPlayer(playerid"~r~Loser"50003);
        
TruckmissionPlaying[playerid] = 0;
        
MissionInfo[ID][IsGettingPlayed] = 0;
         
MissionInfo[ID][TickcountBeforeStart] = 0;
         
DisablePlayerCheckpoint(playerid);
         
SendClientMessage(playeridCOLOR_RED"You failed the Truckmission!");
        
SetVehicleToRespawn(Truck[ID]);
        
KillTimer(MissionInfo[ID][Timer]);
        if(
MissionInfo[ID][UseTrailer] == 1)
        {
            
DestroyVehicle(Trailer[ID]);
        }
    }
}
        
public 
OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    if(!
ispassenger)
    {
        if(
IsTruckmission(vehicleid))
        {
            if(!
LicenseTest[playerid])
            {
                new 
Float:pos[3];
                
GetPlayerPos(playeridpos[0], pos[1], pos[2]);
                
SetPlayerPos(playeridpos[0], pos[1], pos[2]);
                
SendClientMessage(playeridCOLOR_ORANGE"You are not taking a Truckers license ");
            }
            else
            {
                
SendClientMessage(playeridCOLOR_LIGHTBLUE"* GPS: Finish the test by driving through all of the checkpoints on your GPS.");
                
SetPlayerCheckpoint(playerid,980.1932,-1407.9902,13.0956,5);
                
SendClientMessage(playeridCOLOR_RED"If you exit the car your test will be failed and it will have to be re-done.");
            }
        }
    }
    return 
1;
}
        
public 
OnPlayerEnterCheckpoint(playerid)
{
    if(
TruckmissionPlaying[playerid] > && IsPlayerInVehicle(playeridTruck[TruckmissionPlaying[playerid]]))
    {
        new 
ID TruckmissionPlaying[playerid];
        if(
MissionInfo[ID][UseTrailer] == 1)
        {
            if(!
IsTrailerAttachedToVehicle(Truck[ID])) return SendClientMessage(playeridCOLOR_RED"You lost your trailer!");
            
DestroyVehicle(Trailer[ID]);
        }
        
KillTimer(MissionInfo[ID][Timer]);
        
RemovePlayerFromVehicle(playerid);
        
SetVehicleToRespawn(Truck[ID]);
        new 
TotalTime = ((GetTickCount() - MissionInfo[ID][TickcountBeforeStart])/1000);
        new 
string[128];
        
DisablePlayerCheckpoint(playerid);
        
TruckmissionPlaying[playerid] = 0;
        
MissionInfo[ID][IsGettingPlayed] = 0;
        
format(stringsizeof(string), "You completed Truckmission #%d!!! You won $%d!!!"IDMissionInfo[ID][Prize]);
        
SendClientMessage(playeridCOLOR_YELLOWstring);
        
GameTextForPlayer(playerid"~g~Winner!"80003);
        
PlayerPlaySound(playerid1185000);
        
GivePlayerMoney(playeridMissionInfo[ID][Prize]);
        
SetTimerEx("StopSound"80003"i"playerid);
        
format(stringsizeof(string), "It took you %d seconds!"TotalTime);
        
SendClientMessage(playeridCOLOR_YELLOWstring);
        if(
TotalTime MissionInfo[ID][Highscore])
        {
            new 
Pname[MAX_PLAYER_NAME];
            
GetPlayerName(playeridPnamesizeof(Pname));
            
format(stringsizeof(string), "%s has broken the recond of Truckmission #%d! New Highscore: %d seconds"PnameIDTotalTime);
            
SendClientMessageToAll(COLOR_YELLOWstring);
            
MissionInfo[ID][Highscore] = TotalTime;
            
format(MissionInfo[ID][HighscoreName], MAX_PLAYER_NAME"%s"Pname);
        }
    }
    return 
1;
}
public 
OnPlayerSelectedMenuRow(playeridrow)
{
    new 
Menu:Current GetPlayerMenu(playerid);
    if(
Current == SettingsMenu1)
    {
        switch(
row)
        {
            case 
0: {GameTextForPlayer(playerid"~y~Typ the new name ~n~in the chat~"9999993); SpecialAction[playerid] = CHANGE_NAME;}
            case 
1: {GameTextForPlayer(playerid"~y~Are you sure you want this location as new startposition? ~n~~g~/yes ~y~or ~r~/no"9999993); Question 1;}
            case 
2: {GameTextForPlayer(playerid"~y~Are you sure you want this location as new finishposition? ~n~~g~/yes ~y~or ~r~/no"9999993); Question 2;}
            case 
3: {GameTextForPlayer(playerid"~y~Typ the new Checkpointsize ~n~in the chat~"9999993); SpecialAction[playerid] = CHANGE_CPSIZE;}
            case 
4: {GameTextForPlayer(playerid"~y~Typ the new Prize ~n~in the chat~"9999993); SpecialAction[playerid] = CHANGE_PRIZE;}
            case 
5: {GameTextForPlayer(playerid"~y~Typ the new model-id ~n~in the chat~"9999993); SpecialAction[playerid] = CHANGE_MODEL;}
            case 
6: {GameTextForPlayer(playerid"~y~Highscores resetted!"30004); MissionInfo[EditMissionID][Highscore] = 999999format(MissionInfo[EditMissionID][HighscoreName], 24"Nobody"); ShowMenuForPlayer(SettingsMenu1playerid);}
            case 
7: {GetMissionInfo(playeridEditMissionID); ShowMenuForPlayer(SettingsMenu1playerid);}
            case 
8:
            {
                new 
id EditMissionID;
                
DestroyVehicle(Truck[id]);
                
Truck[id] = CreateVehicle(MissionInfo[id][TruckModel], MissionInfo[id][StartX], MissionInfo[id][StartY], MissionInfo[id][StartZ], MissionInfo[id][StartAngle], MissionInfo[id][TruckColor1],MissionInfo[id][TruckColor2], 600000);
                
ShowMenuForPlayer(SettingsMenu1playerid);
            }
            case 
9: {ShowMenuForPlayer(SettingsMenu2playerid);}
        }
    }
    if(
Current == SettingsMenu2)
    {
        switch(
row)
        {
            case 
0: {ShowMenuForPlayer(UseTrailerMenuplayerid);}
            case 
1: {GameTextForPlayer(playerid"~y~Typ the new model-id ~n~in the chat~"9999993); SpecialAction[playerid] = CHANGE_TRAILER;}
            case 
2: {ShowMenuForPlayer(ColorMenuplayerid); }
            case 
3: {GameTextForPlayer(playerid"~y~Typ the new time-limit ~n~(in seconds!) ~n~in the chat~"9999993); SpecialAction[playerid] = CHANGE_TIMELIMIT;}
            case 
4: {ShowMenuForPlayer(SettingsMenu1playerid);}
        }
    }
    if(
Current == UseTrailerMenu)
    {
        switch(
row)
        {
            case 
0: {ShowMenuForPlayer(SettingsMenu2playerid); MissionInfo[EditMissionID][UseTrailer] = 1SendClientMessage(playeridCOLOR_YELLOW"Using a trailer is now enabled for this mission!");}
            case 
1: {ShowMenuForPlayer(SettingsMenu2playerid); MissionInfo[EditMissionID][UseTrailer] = 0SendClientMessage(playeridCOLOR_YELLOW"Using a trailer is now disabled for this mission!");}
            case 
2: {ShowMenuForPlayer(SettingsMenu2playerid);}
        }
    }
    if(
Current == ColorMenu)
    {
        switch(
row)
        {
            case 
0: {GameTextForPlayer(playerid"~y~Typ the new color-id ~n~in the chat~"9999993); SpecialAction[playerid] = CHANGE_COLOR1;}
            case 
1: {GameTextForPlayer(playerid"~y~Typ the new color-id ~n~in the chat~"9999993); SpecialAction[playerid] = CHANGE_COLOR2;}
            case 
2:
            {
                
SendClientMessage(playeridCOLOR_MENUHEADER"=====Common CarColors:============");
                
SendClientMessage(playeridCOLOR_MENU"Black = 0 ** White = 1 ** LightBlue = 2  ** Red = 3");
                
SendClientMessage(playeridCOLOR_MENU"Yellow = 6 ** Green = 86 ** LightGrey = 15 ** Purple = 5");
                
SendClientMessage(playeridCOLOR_MENU"DarkBlue = 79 ** DarkGrey = 13 ** LightBrown = 102");
                
SendClientMessage(playeridCOLOR_MENU"DarkBrown = 30 ** Pink = 126 ** RandomColor = -1");
                
ShowMenuForPlayer(ColorMenuplayerid);
            }
            case 
3: {ShowMenuForPlayer(SettingsMenu2playerid);}
        }
    }
    return 
1;
}
public 
OnPlayerExitedMenu(playerid)
{
    
TogglePlayerControllable(playerid1);
    return 
1;
}
stock CreateNewFile(id)
{
    
format(FileNamesizeof(FileName), MissionFileid);
    new 
name[50];
    
format(namesizeof(name), "Race #%d"id);
    
dini_Create(FileName);
    
dini_Set(FileName"Name"name);
    
dini_FloatSet(FileName"StartX"0.0);
    
dini_FloatSet(FileName"StartY"0.0);
    
dini_FloatSet(FileName"StartZ"0.0);
    
dini_FloatSet(FileName"StartAngle"0.0);
    
dini_FloatSet(FileName"EndX"0.0);
    
dini_FloatSet(FileName"EndY"0.0);
    
dini_FloatSet(FileName"EndZ"0.0);
    
dini_IntSet(FileName"CpSize"DefaultCheckpointSize);
    
dini_IntSet(FileName"TruckModel"DefaultTruckModel);
    
dini_IntSet(FileName"TruckColor1", -1);
    
dini_IntSet(FileName"TruckColor2", -1);
    
dini_IntSet(FileName"UseTrailer"0);
    
dini_IntSet(FileName"TrailerModel"DefaultTrailerModel);
    
dini_IntSet(FileName"Prize"DefaultPrize);
    
dini_IntSet(FileName"TimeLimit"0);
    
dini_IntSet(FileName"Highscore"9999999);
    
dini_Set(FileName"HighscoreName""Nobody");
    
ReadFile(id);
}
stock ReadFile(id)
{
    
format(FileNamesizeof(FileName), MissionFileid);
    
format(MissionInfo[id][Name], 50"%s"dini_Get(FileName"Name"));
    
MissionInfo[id][StartX] = dini_Float(FileName"StartX");
    
MissionInfo[id][StartY] = dini_Float(FileName"StartY");
    
MissionInfo[id][StartZ] = dini_Float(FileName"StartZ");
    
MissionInfo[id][StartAngle] = dini_Float(FileName"StartAngle");
    
MissionInfo[id][EndX] = dini_Float(FileName"EndX");
    
MissionInfo[id][EndY] = dini_Float(FileName"EndY");
    
MissionInfo[id][EndZ] = dini_Float(FileName"EndZ");
    
MissionInfo[id][CpSize] = dini_Int(FileName"CpSize");
    
MissionInfo[id][Prize] = dini_Int(FileName"Prize");
    
MissionInfo[id][TimeLimit] = dini_Int(FileName"TimeLimit");
    
MissionInfo[id][TruckModel] = dini_Int(FileName"TruckModel");
    
MissionInfo[id][TruckColor1] = dini_Int(FileName"TruckColor1");
    
MissionInfo[id][TruckColor2] = dini_Int(FileName"TruckColor2");
    
MissionInfo[id][UseTrailer] = dini_Int(FileName"UseTrailer");
    
MissionInfo[id][TrailerModel] = dini_Int(FileName"TrailerModel");
    
MissionInfo[id][Highscore] = dini_Int(FileName"Highscore");
    
format(MissionInfo[id][HighscoreName], MAX_PLAYER_NAME"%s"dini_Get(FileName"HighscoreName"));
    
Truck[id] = CreateVehicle(MissionInfo[id][TruckModel], MissionInfo[id][StartX], MissionInfo[id][StartY], MissionInfo[id][StartZ], MissionInfo[id][StartAngle], MissionInfo[id][TruckColor1],MissionInfo[id][TruckColor2], 600000);
}
SaveFiles()
{
    for(new 
id=1id<MAX_MISSIONSid++)
    {
        if(
MissionInfo[id][DoesExists] == 1)
        {
            
format(FileNamesizeof(FileName), MissionFileid);
            
dini_Set(FileName"Name"MissionInfo[id][Name]);
            
dini_FloatSet(FileName"StartX"MissionInfo[id][StartX]);
            
dini_FloatSet(FileName"StartY"MissionInfo[id][StartY]);
            
dini_FloatSet(FileName"StartZ"MissionInfo[id][StartZ]);
            
dini_FloatSet(FileName"StartAngle"MissionInfo[id][StartAngle]);
            
dini_FloatSet(FileName"EndX"MissionInfo[id][EndX]);
            
dini_FloatSet(FileName"EndY"MissionInfo[id][EndY]);
            
dini_FloatSet(FileName"EndZ"MissionInfo[id][EndZ]);
            
dini_IntSet(FileName"CpSize"MissionInfo[id][CpSize]);
            
dini_IntSet(FileName"TruckModel"MissionInfo[id][TruckModel]);
            
dini_IntSet(FileName"TruckColor1"MissionInfo[id][TruckColor1]);
            
dini_IntSet(FileName"TruckColor2"MissionInfo[id][TruckColor2]);
            
dini_IntSet(FileName"UseTrailer"MissionInfo[id][UseTrailer]);
            
dini_IntSet(FileName"TrailerModel"MissionInfo[id][TrailerModel]);
              
dini_IntSet(FileName"Prize"MissionInfo[id][Prize]);
              
dini_IntSet(FileName"TimeLimit"MissionInfo[id][TimeLimit]);
              
dini_IntSet(FileName"Highscore"MissionInfo[id][Highscore]);
              
dini_Set(FileName"HighscoreName"MissionInfo[id][HighscoreName]);
        }
    }
}
GetMissionInfo(playeridID)
{
    new 
string[128];
    
format(stringsizeof(string), "Truckmission #%d:  \"%s\""IDMissionInfo[ID][Name]);
    
SendClientMessage(playeridCOLOR_MENUHEADERstring);
    
format(stringsizeof(string), "StartPosition: X:%.2f, Y:%.2f, Z:%.2f  Angle:%.2f "MissionInfo[ID][StartX], MissionInfo[ID][StartY], MissionInfo[ID][StartZ], MissionInfo[ID][StartAngle]);
    
SendClientMessage(playeridCOLOR_MENUstring);
    
format(stringsizeof(string), "FinishPosition: X:%.2f, Y:%.2f, Z:%.2f"MissionInfo[ID][EndX], MissionInfo[ID][EndY], MissionInfo[ID][EndZ]);
    
SendClientMessage(playeridCOLOR_MENUstring);
    
format(stringsizeof(string), "CheckpointSize: %d,  Prize: $%d"MissionInfo[ID][CpSize], MissionInfo[ID][Prize]);
    
SendClientMessage(playeridCOLOR_MENUstring);
    
format(stringsizeof(string), "TruckModel: %d  (%s), TruckColor1: %d, TruckColor2: %d"MissionInfo[ID][TruckModel], VehNames[(MissionInfo[ID][TruckModel]-400)], MissionInfo[ID][TruckColor1], MissionInfo[ID][TruckColor2]);
    
SendClientMessage(playeridCOLOR_MENUstring);
    
format(stringsizeof(string), "Use Trailer: %d,  TrailerModel: %d,  TimeLimit: %d seconds"MissionInfo[ID][UseTrailer], MissionInfo[ID][TrailerModel], MissionInfo[ID][TimeLimit]);
    
SendClientMessage(playeridCOLOR_MENUstring);
    
format(stringsizeof(string), "Highscore: %d seconds,  Highscore by: \"%s\""MissionInfo[ID][Highscore], MissionInfo[ID][HighscoreName]);
    
SendClientMessage(playeridCOLOR_MENUstring);
}
IsNumeric(const string[])
{
    for (new 
0strlen(string); ji++)
    {
        if (
string[i] > '9' || string[i] < '0') return 0;
    }
    return 
1;
}
forward StopSound(playerid);
public 
StopSound(playerid)
{
    
PlayerPlaySound(playerid1186000);
}
IsUsableTruck(model)
{
    switch(
model)
    {
        case 
403514515: { return 1; }
    }
    return 
0;
}
IsUsableTrailer(model)
{
    switch(
model)
    {
        case 
435450591584: { return 1; }
    }
    return 
0;
}
stock IsMissionReady(ID)
{
    if(
MissionInfo[ID][StartX] == 0.0 && MissionInfo[ID][StartY] == && MissionInfo[ID][StartZ] == 0)
    {
        return 
0;
    }
    if(
MissionInfo[ID][EndX] == 0.0 && MissionInfo[ID][EndY] == 0.0 && MissionInfo[ID][EndZ] == 0.0)
    {
        return 
0;
    }
    if(
MissionInfo[ID][TruckModel] == || (MissionInfo[ID][UseTrailer] == && MissionInfo[ID][TrailerModel] == 0) || MissionInfo[ID][CpSize] == 0)
    {
        return 
0;
    }
    return 
1;
}
forward MissionTimer(playeridMissionID);
public 
MissionTimer(playeridMissionID)
{
    
GameTextForPlayer(playerid"~r~Time is up"50003);
    
TruckmissionPlaying[playerid] = 0;
    
MissionInfo[MissionID][IsGettingPlayed] = 0;
     
MissionInfo[MissionID][TickcountBeforeStart] = 0;
    
DisablePlayerCheckpoint(playerid);
     
SendClientMessage(playeridCOLOR_RED"You failed the Truckmission!");
    
SetVehicleToRespawn(Truck[MissionID]);
    if(
MissionInfo[MissionID][UseTrailer] == 1)
    {
        
DestroyVehicle(Trailer[MissionID]);
    }

Reply
#2

sorry for bumping , can any one help me ?
Reply
#3

What is a "requicktmens"?
Reply
#4

I don't really get you - But basically, You'll create a variable - If the var is true it would work and continue - If not , The code would return.

Example

PHP код:
if(PlayerInfo[playerid][pLic] == 0) return SendClientMessage(playeridGREY"    You need a license for this job."); 
You'll create the var at your pInfo enum [if you got one] - Or it can be License[MAX_PLAYERS];

And it would work - You gotta put such line in your code tho

Example :

PHP код:
Mycmd
{
if(
PlayerInfo[playerid][pLic] == 0) return SendClientMessage(playeridGREY"    You need a license for this job.");
{
bla bla 
Quote:

What is a "requicktmens"?

I guess it's pretty obvious - No need to post crap in-order to increase your post-count.
Reply
#5

Basically, just add an IF statement above the code. If I want to allow only players with a var which has a value more than 3, I would:
pawn Код:
CMD:blabla( playerid, params[] )
{
   .. ... . .
   if( player_VAR[ playerid ][ some_level ] < 3 ) // he doesn't meet the requirements
      return SendClientMessage(playerid, -1, "You do not have enough 'some_level' level.");
   else
   {
            the code
    }
    return 1;
}
EDIT: late
Reply
#6

[QUOTE=-CaRRoT;2529858]I don't really get you - But basically, You'll create a variable - If the var is true it would work and continue - If not , The code would return.

Example

PHP код:
if(PlayerInfo[playerid][pLic] == 0) return SendClientMessage(playeridGREY"    You need a license for this job."); 
You'll create the var at your pInfo enum [if you got one] - Or it can be License[MAX_PLAYERS];

And it would work - You gotta put such line in your code tho

Example :

PHP код:
Mycmd
{
if(
PlayerInfo[playerid][pLic] == 0) return SendClientMessage(playeridGREY"    You need a license for this job.");
}
bla bla 
Can you be more spesefic cuz' i really dident understand you where i will put thoes things you told me
Reply
#7

Like this for example :-

PHP код:
    if(strcmp(cmdtext"/truckhelp"true)==0
           { 
           if(
PlayerInfo[playerid][pLic] == 0) return SendClientMessage(playeridGREY"    You need a license for this job.");
             {
              
// your code 
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)