Hey Leute,
Wenn ich else if benutze bricht es nach dem ersten Vorgang (wo nur if steht) ab, bzw. es passiert nichts mehr.
forward TutorialTimer(playerid,npcid);
public TutorialTimer(playerid,npcid)
{
new string[128];
if(TutTime[playerid] <= 1)
{
if(TutTime[playerid] == 1)
{
TutTime[playerid] = 2;
SendClientMessage(playerid,COLOR_GREEN,"bla");
//sleep(1000)<a>;
SendClientMessage(playerid,COLOR_GREEN,"bla");
//sleep(1000)<b>;
format(string,sizeof(string),"%s: Mhhmm",SpielerName(playerid));
SendClientMessage(playerid,COLOR_GREEN,string);
//sleep(1000)<c>;
SendClientMessage(playerid,COLOR_GREEN,"bla");
//sleep(1000)<d>;
//ApplyAnimation(Medic,"MEDIC","CPR",4.1,0,1,1,1,1);
SetTimerEx("TutorialTimer",5 * 1000,0,"dd",playerid,npcid);
}
else if(TutTime[playerid] == 2)
{
TutTime[playerid] = 3;
FCNPC_EnterVehicle(Medic,MedicCar,0,1);
FCNPC_SetSpecialAction(Medic,SPECIAL_ACTION_NONE);
PlayerPlaySound(playerid,1022,0.0,0.0,0.0);
//FCNPC_PutInVehicle(Medic,MedicCar,0);
//sleep(1000)<f>;
SetTimerEx("TutorialTimer",10 * 1000,0,"dd",playerid,npcid);
}
else if(TutTime[playerid] == 3)
{
TutTime[playerid] = 4;
PlayerTextDrawShow(playerid,Textdraw0);
PlayerTextDrawShow(playerid,Textdraw1);
KillTimer(cracklooping);
SetPlayerInterior(playerid, 1);
SetPlayerPos(playerid, 1177.3695, -1340.4095, 9280.5693);
GameTextForPlayer(playerid, "~r~Drei Stunden spaeter...", 5000, 1);
SetPlayerFacingAngle(playerid, 90);
SetCameraBehindPlayer(playerid);
PlayerPlaySound(playerid,6002,0.0,0.0,0.0);
SetTimerEx("TutorialTimer",10 * 1000,0,"dd",playerid,npcid);
}
else if(TutTime[playerid] == 4)
{
PlayerTextDrawHide(playerid,Textdraw0);
PlayerTextDrawHide(playerid,Textdraw1);
FCNPC_Destroy(Medic);
DestroyVehicle(MedicCar);
TogglePlayerControllable(playerid,1);
SetPlayerDrunkLevel(playerid,0);
}
}
return 1;
}