Hallo, und zwar sitze ich gerade an einen Trucker Job
So:
Als 1 muss man /trucking eingeben und dort erscheint ein DIALOG und dort stehen dann aufträge, und sobald man eion ausgewählt hat sollte sich ein Tor öffnen aber dies tut es nicht hier der code:
forward checktrucker();
Das hier in ongamemodeinit
SetTimer("checktrucker",20,true);
hier der DIALOG
if(dialogid == DIALOG_TRUCKING)
{
if(response == 1)
{
switch(listitem)
{
case 0:
{
if(truckingtime11 == 0)
{
truckingtime1=1;
truckingtime11=1;
SetPVarInt(playerid,"Trucking",1);
SetPVarInt(playerid,"Beladen",0);
SendClientMessage(playerid,COLOR_BRIGHTRED,"Gehe nun zum Checkpoint um deinen LKW zu beladen!");
SetPlayerCheckpointEx(playerid,-571.1071,-555.1445,25.5296,3.0);
SetVehicleToRespawn(truckerwagen[0]);
SetVehicleToRespawn(truckerwagen[6]);
}
else
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"Dieser LKW ist schon besetzt!");
}
}
case 1:
{
if(truckingtime12 == 0)
{
truckingtime2=1;
truckingtime12=1;
SetPVarInt(playerid,"Trucking",2);
SetPVarInt(playerid,"Beladen",0);
SendClientMessage(playerid,COLOR_BRIGHTRED,"Gehe nun zum Checkpoint um deinen LKW zu beladen!");
SetPlayerCheckpointEx(playerid,-571.1071,-555.1445,25.5296,3.0);
SetVehicleToRespawn(truckerwagen[1]);
SetVehicleToRespawn(truckerwagen[7]);
}
else
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"Dieser LKW ist schon besetzt!");
}
}
case 2:
{
if(truckingtime13 == 0)
{
truckingtime3=1;
truckingtime13=1;
SetPVarInt(playerid,"Trucking",3);
SetPVarInt(playerid,"Beladen",0);
SendClientMessage(playerid,COLOR_BRIGHTRED,"Gehe nun zum Checkpoint um deinen LKW zu beladen!");
SetPlayerCheckpointEx(playerid,-571.1071,-555.1445,25.5296,3.0);
SetVehicleToRespawn(truckerwagen[2]);
SetVehicleToRespawn(truckerwagen[8]);
}
else
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"Dieser LKW ist schon besetzt!");
}
}
case 3:
{
if(truckingtime14 == 0)
{
truckingtime4=1;
truckingtime14=1;
SetPVarInt(playerid,"Trucking",4);
SetPVarInt(playerid,"Beladen",0);
SendClientMessage(playerid,COLOR_BRIGHTRED,"Gehe nun zum Checkpoint um deinen LKW zu beladen!");
SetPlayerCheckpointEx(playerid,-571.1071,-555.1445,25.5296,3.0);
SetVehicleToRespawn(truckerwagen[3]);
SetVehicleToRespawn(truckerwagen[9]);
}
else
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"Dieser LKW ist schon besetzt!");
}
}
case 4:
{
if(truckingtime15 == 0)
{
truckingtime5=1;
truckingtime15=1;
SetPVarInt(playerid,"Trucking",5);
SetPVarInt(playerid,"Beladen",0);
SendClientMessage(playerid,COLOR_BRIGHTRED,"Gehe nun zum Checkpoint um deinen LKW zu beladen!");
SetPlayerCheckpointEx(playerid,-571.1071,-555.1445,25.5296,3.0);
SetVehicleToRespawn(truckerwagen[4]);
SetVehicleToRespawn(truckerwagen[10]);
}
else
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"Dieser LKW ist schon besetzt!");
}
}
case 5:
{
if(truckingtime16 == 0)
{
truckingtime6=1;
truckingtime16=1;
SetPVarInt(playerid,"Trucking",6);
SetPVarInt(playerid,"Beladen",0);
SendClientMessage(playerid,COLOR_BRIGHTRED,"Gehe nun zum Checkpoint um deinen LKW zu beladen!");
SetPlayerCheckpointEx(playerid,-571.1071,-555.1445,25.5296,3.0);
SetVehicleToRespawn(truckerwagen[5]);
SetVehicleToRespawn(truckerwagen[11]);
}
else
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"Dieser LKW ist schon besetzt!");
}
}
}
}
}
und hier der Public
public checktrucker()
{
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(GetPVarInt(i,"Trucking")==1)
{
truckingtime1=1;
}
else
{
truckingtime1=0;
}
if(GetPVarInt(i,"Trucking")==2)
{
truckingtime2=1;
MoveObject(truckingtor2, -595.7999878,-522.5999756,16.2999992, 4.00);
}
else
{
truckingtime2=0;
MoveObject(truckingtor2, -595.7999878,-522.5999756,26.2999992, 4.00);
}
if(GetPVarInt(i,"Trucking")==3)
{
truckingtime3=1;
MoveObject(truckingtor3, -559.7999878,-522.5999756,16.2999992, 4.00);
}
else
{
truckingtime3=0;
MoveObject(truckingtor3, -559.7999878,-522.5999756,26.2999992, 4.00);
}
if(GetPVarInt(i,"Trucking")==4)
{
truckingtime4=1;
MoveObject(truckingtor4, -568.7999878,-522.5999756,16.2999992, 4.00);
}
else
{
truckingtime4=0;
MoveObject(truckingtor4, -568.7999878,-522.5999756,26.2999992, 4.00);
}
if(GetPVarInt(i,"Trucking")==5)
{
truckingtime5=1;
MoveObject(truckingtor5, -577.7999878,-522.5999756,16.2999992, 4.00);
}
else
{
truckingtime5=0;
MoveObject(truckingtor5, -577.7999878,-522.5999756,26.2999992, 4.00);
}
if(GetPVarInt(i,"Trucking")==6)
{
truckingtime6=1;
MoveObject(truckingtor6, -586.7999878,-522.5999756,16.2999992, 4.00);
}
else
{
truckingtime6=0;
MoveObject(truckingtor6, -586.7999878,-522.5999756,26.2999992, 4.00);
}
}
}