07.10.2011, 22:19
hi i got little problem :/
look:
this is just code that will start random mission for a player...
but look at this line:
normally this should create a 3D text but it only creates a text whe, the index is 3...
so when rand == 3
only then it will proceed that 3D text stuff...
any help?
look:
pawn Код:
StartDriverMissionForPlayer(playerid,level)
{
new string[1000];
new
rand = random(sizeof Mission1),
rand2 = random(sizeof Mission2),
rand3 = random(sizeof Mission3);
new
Float:Mpx,
Float:Mpy,
Float:Mpz;
// default messages for all different types
SendClientMessage(playerid, COLOR_SEXYGREEN, " ");
SendClientMessage(playerid, COLOR_SEXYGREEN, " ");
SendClientMessage(playerid, COLOR_SEXYGREEN, "|==========================================================|");
// toggles
new engine,lights,alarm,doors,bonnet,boot,objective;
IsWorking[playerid] = true;
OldVehicleID[playerid] = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(OldVehicleID[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(OldVehicleID[playerid],engine,lights,alarm,doors,bonnet,boot,1);
TogglePlayerControllable(playerid, 0);
// Timer, called every 1 second
VehicleTimer[playerid] = SetTimerEx("Trucker_VehicleTimer", 1000, true, "d" , playerid);
if(gTeam[playerid] == TEAM_DRIVERS && level == 1)
{
// messages
format(string, sizeof string, "Mission: {FF6347}%s", Mission1[rand][mission_nickname]);
SendClientMessage(playerid, COLOR_SEXYGREEN, string);
SendClientMessage(playerid, COLOR_SEXYGREEN, "|==========================================================|");
SendClientMessage(playerid, COLOR_SEXYGREEN, "A {FF6347}Level 1 {00FF00}Driving Mission");
format(string, sizeof string, "Bring: {4169FF}\"%s\" {00FF00}From {4169FF}\"%s\" {00FF00}To {4169FF}\"%s\"", Mission1[rand][person_name],Mission1[rand][pick_place],Mission1[rand][deliver_place]);
SendClientMessage(playerid, COLOR_SEXYGREEN, string);
// Textdraw
format(string, sizeof string, "~w~Bring ~y~%s ~w~From ~r~~h~~h~~g~~h~~h~%s~r~~h~~h~ ~w~To %s", Mission1[rand][person_name],Mission1[rand][pick_place],Mission1[rand][deliver_place]);
TextDrawSetString(Opdracht, string);
TextDrawShowForPlayer(playerid,Opdracht);
// GameText
format(string, sizeof string, "%s", Mission1[rand][mission_name]);
GameTextForPlayer(playerid,string,3000,3);
// MapIcon
Mpx = Mission1[rand][pick_x];
Mpy = Mission1[rand][pick_y];
Mpz = Mission1[rand][pick_z];
Mcheck[0] = CreateDynamicCP(Mpx, Mpy, Mpz, 2.0, -1, -1, playerid, 400000.0);
// Gametext
/*SetTimerEx("gtchange", 5000, false, "i", playerid);
SetTimerEx("camerachange", 10000, false, "i", playerid);*/
SetTimerEx("camerares", 15000, false, "i", playerid);
// 3DText
format(string, sizeof string, "Drving \"%s\"", Mission1[rand][person_name]);
Mpassenger[playerid] = Create3DTextLabel(string,COLOR_WHITE,745.2821,-1274.2109,13.5547,200,-1);
Attach3DTextLabelToVehicle(Text3D:Mpassenger[playerid], OldVehicleID[playerid], 0.0, 0.0, 0.7);
// variables
rand = CurrentMissionIndex;
}
but look at this line:
pawn Код:
format(string, sizeof string, "Drving \"%s\"", Mission1[rand][person_name]);
Mpassenger[playerid] = Create3DTextLabel(string,COLOR_WHITE,745.2821,-1274.2109,13.5547,200,-1);
Attach3DTextLabelToVehicle(Text3D:Mpassenger[playerid], OldVehicleID[playerid], 0.0, 0.0, 0.7);
so when rand == 3
only then it will proceed that 3D text stuff...
any help?