SA-MP Forums Archive
Work command does not work on shamal - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Work command does not work on shamal (/showthread.php?tid=347809)



Work command does not work on shamal - Neil. - 03.06.2012

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


Re: Work command does not work on shamal - Neil. - 03.06.2012

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


Re: Work command does not work on shamal - Smokkr - 03.06.2012

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


Re: Work command does not work on shamal - Neil. - 03.06.2012

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