Idea why this isnt working ?
#1

Hello , im making an Uniq Trucking system for my server ,

this last i want to make if player typed cmd ( /startcdl) and selected the first Item ,

server will check his Truck if is a truck legal to let the cmd working ,
second : this where im having the problem - if he chosen the first Case he will need Oil Trailer to do it ,
if he clicks the second he will need artic to do it
if he clicks the third case he will need Soil artic to do it , but when im having the Oil Trailer and im clicking on the First Case he's is telling me " This mission Cant be done without Oil Trailer" even i have oil trailer attached ..

PHP код:
stock IsCDLTRUCK(carid)
{
    new 
model GetVehicleModel(carid);
    if(
model == 514 || model == 515 || model == 403)
    {
        return 
1;
    }
    return 
0;
}
stock IsCDLTrailer(carid)
{
    new 
model GetVehicleModel(carid);
    if(
model == 584 || model == 591 || model == 435 || model == 450)
    {
        return 
1;
    }
    return 
0;
}
stock IsCDLOil(carid)
{
    new 
model GetVehicleModel(carid);
    if(
model == 584)
    {
        return 
1;
    }
    return 
0;
}
stock IsCDLArtic(carid)
{
    new 
model GetVehicleModel(carid);
    if(
model == 591 || model == 435)
    {
        return 
1;
    }
    return 
0;
}
stock IsCDLSOLA(carid)
{
    new 
model GetVehicleModel(carid);
    if(
model == 450)
    {
        return 
1;
    }
    return 
0;

PHP код:

YCMD
:startcdl(playeridparams[], help)
{
    if(
help) return SCM(playeridCOLOR_GREY"Not supported");
    new 
carid GetPlayerVehicleID(playerid);
    if(
PlayerInfo[playerid][pCDLic] == 1)
    {
        if(
IsCDLTRUCK(carid))
        {
            
PAP[playerid] = 1;
            
ShowPlayerDialog(playerid9111DIALOG_STYLE_LIST"Choose any of those locations""Load  Fuel  \nLoad Boxes \nLoad Traps""Ok""Cancel"); 
            return 
1;
        }    
        else
        {
            
SCM(playeridCOLOR_GREY"*You cant be Runningthis without your Own able Truck");
            return 
1;
        }
    }    
    return 
1;

PHP код:

if(dialogid == 9111
    {
        if(!
response) return 0
        if(
response
        {
            new 
carid GetPlayerVehicleID(playerid);
            new 
vehicleid GetPlayerVehicleID(playerid);
            if(
listitem == 0
            {    
                if(
IsCDLTRUCK(carid) && IsTrailerAttachedToVehicle(vehicleid))
                {    
                    if(
GetVehicleTrailer(carid) != IsCDLOil(carid)) return SCM(playeridCOLOR_RED"You need Oil Trailer to Do this mission");
                    
PAP[playerid] = 1
                    
SetPlayerCheckpoint(playerid, -269.1287,2610.6057,63.20693.0); 
                    
SendClientMessage(playerid0xFFFFFFFF"You started your first mission. Please follow the checkpoints");
                    return 
1;
                }    
            }
            if(
listitem == 1)
            {
                if(
IsCDLTRUCK(carid) && IsTrailerAttachedToVehicle(vehicleid))
                {    
                    if(
GetVehicleTrailer(carid) != IsCDLArtic(carid)) return SCM(playeridCOLOR_RED"You need ARtic Trailer to do this mission");
                    
PAP[playerid] = 3;
                    
SetPlayerCheckpoint(playerid, -1051.4005,-655.8729,31.73613.0);
                    
SendClientMessage(playerid0xFFFFFFFF"You started your first mission. Please follow the checkpoints");
                    return 
1;
                }
            }
            if(
listitem == 2)
            {
                if(
IsCDLTRUCK(carid) && IsTrailerAttachedToVehicle(vehicleid))
                {    
                    if(
GetVehicleTrailer(carid) != IsCDLSOLA(carid)) return SCM(playeridCOLOR_RED"You need A Soil Artic  to do this mission");
                    
PAP[playerid] = 5
                    
SetPlayerCheckpoint(playerid, -2286.7529,2282.9390,5.90153.0); 
                    
SendClientMessage(playerid0xFFFFFFFF"You started your first mission. Please follow the checkpoints");
                    return 
1;     
                }
            }
        }
    } 
Reply


Messages In This Thread
Idea why this isnt working ? - by MCZOFT - 28.11.2014, 19:44
Re : Idea why this isnt working ? - by MCZOFT - 29.11.2014, 16:12
Re: Idea why this isnt working ? - by CutX - 29.11.2014, 16:24
Re : Idea why this isnt working ? - by MCZOFT - 29.11.2014, 17:31
Re: Idea why this isnt working ? - by PT - 29.11.2014, 17:50
Re : Idea why this isnt working ? - by MCZOFT - 29.11.2014, 18:33
Re : Idea why this isnt working ? - by MCZOFT - 30.11.2014, 01:26

Forum Jump:


Users browsing this thread: 1 Guest(s)