03.06.2012, 08:22
PHP код:
CMD:work(playerid, params[])
{
#pragma unused params
new vehicleid = GetPlayerVehicleID(playerid);
new pvehiclemodel = GetVehicleModel(GetPlayerVehicleID(playerid));
if(!IsWorkingVeh(playerid,pvehiclemodel)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Invalid Vehicle");
if(IsPlayerInMission[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "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(string, sizeof(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(string, sizeof(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(string, sizeof(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(string, sizeof(string), "MISSION: %s", ShamalRandom[rand][MissionName]);
SendClientMessage(playerid,0xFF9900FF,string);
}
}
return 1;
}
PHP код:
Error: No Trailer Attached