22.11.2010, 21:38
i think my code big O-o any way to make it shorter or its ok?
PHP код:
if(!strcmp("/work", cmdtext, true))
{
if (minfo[playerid][CheckpointID] == 0)
{
new pvehiclemodel = GetVehicleModel(GetPlayerVehicleID(playerid));
if (pvehiclemodel == 403 || pvehiclemodel == 514 || pvehiclemodel == 515)
{
if (IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
new string[200];
new rand = random(sizeof(TruckingMissionRandom));
CreatePlayerMission(playerid, TruckingMissionRandom[rand][UseTrailerCheck], TruckingMissionRandom[rand][MissionPay], TruckingMissionRandom[rand][loadx],TruckingMissionRandom[rand][loady], TruckingMissionRandom[rand][loadz], TruckingMissionRandom[rand][unloadx],TruckingMissionRandom[rand][unloady], TruckingMissionRandom[rand][unloadz]);
format(string, sizeof(string), "You are doing mission: %s", TruckingMissionRandom[rand][MissionName]);
SendClientMessage(playerid, 0x00FF00FF, string);
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Im sorry but this mission requires that you use a vehicle that can pull a semi trailer Ex: Roadtrain with an Artict1!");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "you need truck and tailer to be able to work");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "you already have work");
}
return 1;
}