Guten Abend.
Ich habe zwar jetzt schon mein Buslinie mit ein Dialog hinbekommen durch Hilfe.
Ich frage mich wie ich bei den einzelnen Linien anderes Geld bekomme
es sieht so aus:
Dialog:
#define DIALOG_Buslinien 5
Meine Enums für die Linien:
enum bus1Enum{
Float:g_x,
Float:g_y,
Float:g_z
}
enum bus2Enum{
Float:v_x,
Float:v_y,
Float:v_z
}
enum bus3Enum{
Float:n_x,
Float:n_y,
Float:n_z
}
enum bus4Enum{
Float:m_x,
Float:m_y,
Float:m_z
}
new bust1cps[][bus1Enum]={
{1135.5480,-1693.4392,13.7931}, // busstarten
{1722.2972,-1599.5205,13.5478},//buscp 1
{1526.4220,-1660.5486,13.4871}, //buscp1
{1467.7390,-1728.8627,13.4710}, //buscp1
{1361.6545,-1285.1267,13.5398}, //buscp1
{1446.1191,-1029.5895,23.8441},//buscp 1
{1275.4427,-1380.3951,13.3839} //buscp1 letzte
};
/*new bust2cps[][bus2Enum]={
Koordinaten
};
new bust3cps[][bus3Enum]={
Koordinaten
};
new bust4cps[][bus4Enum]={
Koordinaten
}; */
Mein Befehl:
ocmd:buslinie(playerid,params[])
{
if(!IsPlayerInRangeOfPoint(playerid,5,1135.5480,-1693.4392,13.7931))return
SendClientMessage(playerid,helblau,"Du kannst den Job hier nicht starten");
new Float:ox,Float:oy,Float:oz,Float:or;
GetPlayerPos(playerid,ox,oy,oz);
GetPlayerFacingAngle(playerid,or);
new vID = CreateVehicle(431,ox,oy,oz,or,-1,-1,-1);
SetPVarInt(playerid,"bus_car",vID);
SendClientMessage(playerid,rot,"Du hast dein Routenplaner geöffnent.");
SetPVarInt(playerid,"bus_cp",0);
SetPVarInt(playerid,"bus_job",1);
PutPlayerInVehicle(playerid,vID,0);
ShowPlayerDialog(playerid,DIALOG_Buslinien,DIALOG_STYLE_LIST,"Busstrecke.","Buslinie1\nBuslinie2\nBuslinie3\nBuslinie4","Annehmen","Abbrechen");
return 1;
}
EnterCheckpoints:
Nur wo bus_job und bus_cp steht beachten:
public OnPlayerEnterCheckpoint(playerid)
{
if(GetPVarInt(playerid, "trash_job"))
{
//Wenn trash job ausgeführt wird
new cID = GetPVarInt(playerid, "trash_cp");
if(IsPlayerInRangeOfPoint(playerid, 5, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z]))
{
cID++;
if(cID >= sizeof(tCPs))
{
GivePlayerMoney(playerid, 3000);
SetPVarInt(playerid, "trash_cp", 0);
SetPlayerCheckpoint(playerid, tCPs[0][t_x], tCPs[0][t_y], tCPs[0][t_z], 5);
SendClientMessage(playerid,helblau,"Du hast soeben 3.000$ verdient");
}
else
{
SetPVarInt(playerid, "trash_cp", cID);
SetPlayerCheckpoint(playerid, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z], 5);
}
return 1;
}
}
if(GetPVarInt(playerid,"bus_job"))
{
//wenn bus_job ausgeführt wird.
new bID = GetPVarInt(playerid,"bus_cp");
if(IsPlayerInRangeOfPoint(playerid,5,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z]))
{
bID++;
if(bID >= sizeof(bust1cps))
{
GivePlayerMoney(playerid,6000);
SetPVarInt(playerid,"bus_cp",0);
SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 6.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z],5);
}
}
}
DisablePlayerCheckpoint(playerid);
return 1;
}
Hier der teile wo die Linien drin stehen später:
if(dialogid==DIALOG_Buslinien)
{
if(response)
{
if(listitem== 0)
{
if(!IsPlayerInRangeOfPoint(playerid,5,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return
SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
}
if(listitem== 1)
{
//Busliniet2
if(!IsPlayerInRangeOfPoint(playerid,5,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return
SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
}
if(listitem== 2)
{
//Buslinie3
if(!IsPlayerInRangeOfPoint(playerid,5,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return
SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
}
if(listitem== 3)
{
//Buslinie 4
if(!IsPlayerInRangeOfPoint(playerid,5,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return
SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
}
}
else
{
SendClientMessage(playerid,grün,"Du hast keine Buslinie ausgewählt.");
RemovePlayerFromVehicle(playerid);
DestroyVehicle(431);
return 1;
}
}
return 1;
}
Nun frage ich mich wie ich das geld für die routen anders bekommen