Habe ein kleines Problem, wenn ich meinen Befehl eingebe funktioniert er nur in den Vehicleid's 511,519 und 593. Wenn ich es in den anderen Flugzeugen/Heli's mache sagt der Server invalid Command und es wird kein Checkpoint gesetzt. Ich weiß, ist nicht sehr schön eingerückt aber sollte dennoch funktionieren.
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/work", true))
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 511 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 519 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 593)//Beagle+Dodo+Shamal
{
new id = GetNearestAirport(playerid);
Flughafen[playerid] = id;
FlughafenNr[playerid] = 1;
DisablePlayerCheckpoint(playerid);
new message[128];
SetPlayerRaceCheckpoint(playerid,2,Splanes[id][x],Splanes[id][y],Splanes[id][z],0,0,0,Splanes[id][size]);
format(message,sizeof(message), "Head to {1B8AE4}%s {FFFFFF}and pick up your passengers.", Splanes[id][LocationName]);
SendClientMessage(playerid, 0xFFFFFFFF, message);
return 1;
}
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 488 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 497 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 548 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 563)//helis
{
new id = GetNearestAirport(playerid);
Flughafen[playerid] = id;
FlughafenNr[playerid] = 1;
DisablePlayerCheckpoint(playerid);
new message[128];
SetPlayerRaceCheckpoint(playerid,2,Hplanes[id][x],Hplanes[id][y],Hplanes[id][z],0,0,0,Hplanes[id][size]);
format(message,sizeof(message), "Head to {1B8AE4}%s {FFFFFF}and pick up your passengers.", Hplanes[id][LocationName]);
SendClientMessage(playerid, 0xFFFFFFFF, message);
return 1;
}
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 417 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 425 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 447 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 469 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 487)
{
new id = GetNearestAirport(playerid);
Flughafen[playerid] = id;
FlughafenNr[playerid] = 1;
DisablePlayerCheckpoint(playerid);
new message[128];
SetPlayerRaceCheckpoint(playerid,2,Hplanes[id][x],Hplanes[id][y],Hplanes[id][z],0,0,0,Hplanes[id][size]);
format(message,sizeof(message), "Head to {1B8AE4}%s {FFFFFF}and pick up your passengers.", Hplanes[id][LocationName]);
SendClientMessage(playerid, 0xFFFFFFFF, message);
return 1;
}
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 592 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 577)
{
new id = GetNearestAirport(playerid);
Flughafen[playerid] = id;
FlughafenNr[playerid] = 1;
DisablePlayerCheckpoint(playerid);
new message[128];
SetPlayerRaceCheckpoint(playerid,2,Bplanes[id][x],Bplanes[id][y],Bplanes[id][z],0,0,0,Bplanes[id][size]);
format(message,sizeof(message), "Head to {1B8AE4}%s {FFFFFF}and pick up your passengers.", Bplanes[id][LocationName]);
SendClientMessage(playerid, 0xFFFFFFFF, message);
return 1;
}
return 0;
}