Work command does not work on shamal
#1

PHP код:
CMD:work(playeridparams[])
{
#pragma unused params
    
new vehicleid GetPlayerVehicleID(playerid);
    new 
pvehiclemodel GetVehicleModel(GetPlayerVehicleID(playerid));
    if(!
IsWorkingVeh(playerid,pvehiclemodel)) return SendClientMessage(playerid0xFF0000FF"ERROR: Invalid Vehicle");
    if(
IsPlayerInMission[playerid] == 1) return SendClientMessage(playerid0xFF0000AA"ERROR: Already in a mission. Use /stopwork or /s to cancel mission");
    new 
string[350];
    {
        if(!
IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid,0xFF0000FF,"ERROR: No trailer attached");
        if(
GetVehicleModel(vehicleid) == 403) {
        
workingvehicle[playerid] = GetPlayerVehicleID(playerid);
        new 
rand random(sizeof(Trailer1Missions));
        
CreatePlayerMission(playerid,Trailer1Missions[rand][UseTrailerCheck], Trailer1Missions[rand][MissionPay], Trailer1Missions[rand][loadx],Trailer1Missions[rand][loady], Trailer1Missions[rand][loadz], Trailer1Missions[rand][unloadx],Trailer1Missions[rand][unloady], Trailer1Missions[rand][unloadz]);
        
format(stringsizeof(string), "MISSION: %s"Trailer1Missions[rand][MissionName]);
        
SendClientMessage(playerid,0xFF9900FF,string);
        }
//TextDrawSetString(info[playerid],Trailer1Missions[rand][MissionName]);
        
if(!IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid,0xFF0000FF,"ERROR: No trailer attached");
        if(
GetVehicleModel(vehicleid) == 514) {
        
workingvehicle[playerid] = GetPlayerVehicleID(playerid);
        new 
rand random(sizeof(Trailer1Missions));
        
CreatePlayerMission(playerid,Trailer1Missions[rand][UseTrailerCheck], Trailer1Missions[rand][MissionPay], Trailer1Missions[rand][loadx],Trailer1Missions[rand][loady], Trailer1Missions[rand][loadz], Trailer1Missions[rand][unloadx],Trailer1Missions[rand][unloady], Trailer1Missions[rand][unloadz]);
        
format(stringsizeof(string), "MISSION: %s"Trailer1Missions[rand][MissionName]);
        
SendClientMessage(playerid,0xFF9900FF,string);
        }
        if(!
IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid,0xFF0000FF,"ERROR: No trailer attached");
        if(
GetVehicleModel(vehicleid) == 515) {
        
workingvehicle[playerid] = GetPlayerVehicleID(playerid);
        new 
rand random(sizeof(Trailer1Missions));
        
CreatePlayerMission(playerid,Trailer1Missions[rand][UseTrailerCheck], Trailer1Missions[rand][MissionPay], Trailer1Missions[rand][loadx],Trailer1Missions[rand][loady], Trailer1Missions[rand][loadz], Trailer1Missions[rand][unloadx],Trailer1Missions[rand][unloady], Trailer1Missions[rand][unloadz]);
        
format(stringsizeof(string), "MISSION: %s"Trailer1Missions[rand][MissionName]);
        
SendClientMessage(playerid,0xFF9900FF,string);
        }
        if(
GetVehicleModel(vehicleid) == 519) {       //Shamal
        
new rand random(sizeof(ShamalRandom));
        
CreatePlayerMission(playerid,ShamalRandom[rand][UseTrailerCheck], ShamalRandom[rand][MissionPay], ShamalRandom[rand][loadx],ShamalRandom[rand][loady], ShamalRandom[rand][loadz], ShamalRandom[rand][unloadx],ShamalRandom[rand][unloady], ShamalRandom[rand][unloadz]);
        
format(stringsizeof(string), "MISSION: %s"ShamalRandom[rand][MissionName]);
        
SendClientMessage(playerid,0xFF9900FF,string);
        }
    }
    return 
1;

I don't know why but it says
PHP код:
ErrorNo Trailer Attached 
when i /work in game with a shamal
Reply
#2

Quote:

if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(p layerid))) return SendClientMessage(playerid,0xFF0000FF,"ERROR: No trailer attached");

LOL What? If it is like this, then it will return the message instead of doing what is inside the {} brackets

EDIT: What i want, is that the /work should be working with the vehicle shamal (519), but it returns, No Trailer Attached
Reply
#3

This mode is trucking and to work the command /work you need to atach a trailer.On Shamal you can't atach any trailes!
Reply
#4

Quote:
Originally Posted by Smokkr
Посмотреть сообщение
This mode is trucking and to work the command /work you need to atach a trailer.On Shamal you can't atach any trailes!
It's a trucking include, you can choose between choosing a trailer or not
For example
PHP код:
{"San Fierro Airport Gate 1 to Las Venturas Airport Gate 1 with 219 Passengers"false,26999,-1371359,-2213484,1580.13533.43272,10.2324
The false there, marks it able to work WITHOUT the use of trailers


EDIT: Solved lol, silly me, I just needed to adjust the trailer thingy both on the command and the mission itself
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)