28.11.2014, 19:44
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 ..
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(playerid, params[], help)
{
if(help) return SCM(playerid, COLOR_GREY, "Not supported");
new carid = GetPlayerVehicleID(playerid);
if(PlayerInfo[playerid][pCDLic] == 1)
{
if(IsCDLTRUCK(carid))
{
PAP[playerid] = 1;
ShowPlayerDialog(playerid, 9111, DIALOG_STYLE_LIST, "Choose any of those locations", "Load Fuel \nLoad Boxes \nLoad Traps", "Ok", "Cancel");
return 1;
}
else
{
SCM(playerid, COLOR_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(playerid, COLOR_RED, "You need Oil Trailer to Do this mission");
PAP[playerid] = 1;
SetPlayerCheckpoint(playerid, -269.1287,2610.6057,63.2069, 3.0);
SendClientMessage(playerid, 0xFFFFFFFF, "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(playerid, COLOR_RED, "You need ARtic Trailer to do this mission");
PAP[playerid] = 3;
SetPlayerCheckpoint(playerid, -1051.4005,-655.8729,31.7361, 3.0);
SendClientMessage(playerid, 0xFFFFFFFF, "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(playerid, COLOR_RED, "You need A Soil Artic to do this mission");
PAP[playerid] = 5;
SetPlayerCheckpoint(playerid, -2286.7529,2282.9390,5.9015, 3.0);
SendClientMessage(playerid, 0xFFFFFFFF, "You started your first mission. Please follow the checkpoints");
return 1;
}
}
}
}