playMASSIVE poste bitte den Code dazu damit man besser helfen kan
Beiträge von Blackshadowscript
-
-
könntest du mal dein Jobcode posten damit man dir helfen kann
-
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") == 1)
{
//wenn bus_job ausgeführt wird.
new bID = GetPVarInt(playerid,"bus_cp");
if(IsPlayerInRangeOfPoint(playerid,7,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);
}
}
}
else if(GetPVarInt(playerid,"bus_job") == 1)
{
//wenn bus_job ausgeführt wird.
new bID = GetPVarInt(playerid,"bus_cp");
if(IsPlayerInRangeOfPoint(playerid,7,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z]))
{
bID++;
if(bID >= sizeof(bust2cps))
{
GivePlayerMoney(playerid,12000);
SetPVarInt(playerid,"bus_cp",0);
SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 12.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z],5);
}
}
else if (GetPVarInt(playerid,"bus_job") == 1)
{
if(IsPlayerInRangeOfPoint(playerid,7,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z]))
{
bID++;
if(bID >= sizeof(bust3cps))
{
GivePlayerMoney(playerid,15000);
SetPVarInt(playerid,"bus_cp",8);
SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 15.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
}
}
else if(GetPVarInt(playerid,"bus_job") == 1)
{
if(IsPlayerInRangeOfPoint(playerid,7,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z]))
{
bID++;
if(bID >= sizeof(bust4cps))
{
GivePlayerMoney(playerid,30000);
SetPVarInt(playerid,"bus_cp",8);
SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 30.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
}
}
}
}
}
DisablePlayerCheckpoint(playerid);
return 1;
}PS: Ich weiß das da auch vom Müllwagen die Checkpoints sind.
-
Kaito-sensei ich habe bei mir auf dem PC auch ein extra account für die db gemacht aber der wird nicht verbunden. Da habe ich das mal ohne pw gemacht und dann ging es
-
Sieht jetzt so aus Jeffry
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]={
{1135.5480,-1693.4392,13.7931}, // busstarten
{1378.1691,-1876.8495,13.1888},
{1937.2477,-2171.4868,13.1890},
{2327.6970,-2054.9773,13.1441},
{2719.7451,-2029.7438,13.1351},
{2774.6575,-1942.9828,13.1381},
{2683.9724,-1871.7905,10.6911},
{2741.3979,-1610.1760,12.5695},
{2682.0027,-1459.3654,30.1905},
{2418.9873,-1251.8312,23.5439},
{2007.6500,-1455.2505,13.1968}
};
new bust3cps[][bus3Enum]={
{1135.5480,-1693.4392,13.7931}, // busstarten
{1679.9683,-1293.2322,13.6465},
{1453.7729,-1029.0790,23.4661},
{1330.3799,-920.0157,36.3406},
{1208.4860,-930.5677,42.5413},
{1000.6902,-953.3558,41.7086},
{820.6417,-1032.6522,24.7459},
{792.3692,-1120.2891,23.4660},
{937.4135,-1202.0179,17.4626}
};
new bust4cps[][bus4Enum]={
{1135.5480,-1693.4392,13.7931}, // busstarten
{912.7061,-1544.2203,13.1864},
{1373.5081,-1737.3380,13.1889},
{1460.0719,-1386.0859,13.1890},
{1191.4703,-1472.5956,13.1890},
{1087.5948,-1707.3693,13.1890},
{978.7953,-1567.1348,13.2248},
{484.9120,-1577.5508,21.0505},
{454.7106,-1498.5461,30.7047},
{343.1253,-1523.9889,33.0096},
{280.3340,-1643.8889,33.0396},
{425.5682,-1696.6198,9.6370},
{237.6003,-1737.2343,3.8593}
};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") == 1)
{
//wenn bus_job ausgeführt wird.
new bID = GetPVarInt(playerid,"bus_cp");
if(IsPlayerInRangeOfPoint(playerid,7,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);
}
}
}
else if(GetPVarInt(playerid,"bus_job") == 1)
{
//wenn bus_job ausgeführt wird.
new bID = GetPVarInt(playerid,"bus_cp");
if(IsPlayerInRangeOfPoint(playerid,7,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z]))
{
bID++;
if(bID >= sizeof(bust2cps))
{
GivePlayerMoney(playerid,12000);
SetPVarInt(playerid,"bus_cp",0);
SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 12.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z],5);
}
}
else if (GetPVarInt(playerid,"bus_job") == 1)
{
if(IsPlayerInRangeOfPoint(playerid,7,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z]))
{
bID++;
if(bID >= sizeof(bust3cps))
{
GivePlayerMoney(playerid,15000);
SetPVarInt(playerid,"bus_cp",8);
SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 15.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
}
}
else if(GetPVarInt(playerid,"bus_job") == 1)
{
if(IsPlayerInRangeOfPoint(playerid,7,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z]))
{
bID++;
if(bID >= sizeof(bust4cps))
{
GivePlayerMoney(playerid,30000);
SetPVarInt(playerid,"bus_cp",8);
SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 30.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
}
}
}
}
}
DisablePlayerCheckpoint(playerid);
return 1;
}public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==DIALOG_AUTOHAUS)
{
if(response)
{
//Autoverkauf
new id=GetPVarInt(playerid,"buyCarID");
if(GetPlayerMoney(playerid)<ahCars[id][c_preis])
{
SendClientMessage(playerid,gelb,"Du besitzt nicht das benötige Geld für das Fahrzeug");
RemovePlayerFromVehicle(playerid);
return 1;
}
GivePlayerMoney(playerid,-ahCars[id][c_preis]);
createPlayerCar(playerid,ahCars[id][model],ahInfo[ahCars[id][ah_id]][v_x],ahInfo[ahCars[id][ah_id]][v_y],ahInfo[ahCars[id][ah_id]][v_z],ahInfo[ahCars[id][ah_id]][v_r]);
SendClientMessage(playerid,grün,"Sie haben sich erfolgreich ein Fahrzeug gekauft.");
RemovePlayerFromVehicle(playerid);
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,türkis,"Du hast den Kaufvorgang abgebrochen.");}
return 1;
}
if(dialogid==DIALOG_LOGIN)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[128],passwort[35];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>0)
{
mysql_escape_string(inputtext,passwort,dbhandle);
format(query,sizeof(query),"SELECT * FROM user WHERE username='%s' AND passwort=MD5('%s')",name,passwort);
mysql_function_query(dbhandle,query,true,"OnPasswordResponse","i",playerid);
}
else
{
//Keine Eingabe
SendClientMessage(playerid,grün,"Gibt bitte dein Passwort ein.");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gibt bitte dein Passwort ein:","Anmelden","Abbrechen");
SetPlayerScore(playerid,sInfo[playerid][level]);
}
}
else
{
Kick(playerid);
}
return 1;
}
if(dialogid==DIALOG_REGISTER)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[128],passwort[35];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>5)
{
//Registrierungsfunktion
mysql_escape_string(inputtext,passwort,dbhandle);
format(query,sizeof(query),"INSERT INTO user (username,passwort) VALUES ('%s',MD5('%s')) ",name,passwort);
mysql_function_query(dbhandle,query,false,"","");
sInfo[playerid][level]=1;
SetPlayerScore(playerid,sInfo[playerid][level]);
}
else
{
//Kleiner als 4 Zeichen
SendClientMessage(playerid,helblau,"Dein Passwort muss mindestens 6 Zeichen lang sein.");
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Account Erstellung","Gebe bitte nun dein gewünschtes Passwort ein!","Erstellen","Abbrechen");
}
}
else
{
Kick(playerid);
}
return 1;
}
if(dialogid==DIALOG_TELEPORT)
{
if(response)
{
if(listitem==0)
{
//Autohaus
SetPlayerPos(playerid,2502.1106,1706.7172,10.8203);
SetPlayerFacingAngle(playerid,95.2747);
}
}
else
{
SendClientMessage(playerid,rot,"Vorgang abgebrochen.");
}
return 1;
}
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,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z]))return
SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);}
if(listitem== 2)
{
//Buslinie3
if(!IsPlayerInRangeOfPoint(playerid,5,bust3cps[0][n_x],bust3cps[0][n_y],bust3cps[0][n_z]))return
SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
SetPlayerCheckpoint(playerid,bust3cps[0][n_x],bust3cps[0][n_y],bust3cps[0][n_z],5);
}if(listitem== 3)
{
//Buslinie 4
if(!IsPlayerInRangeOfPoint(playerid,5,bust4cps[0][m_x],bust4cps[0][m_y],bust4cps[0][m_z]))return
SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
SetPlayerCheckpoint(playerid,bust4cps[0][m_x],bust4cps[0][m_y],bust4cps[0][m_z],5);
}
}
else
{
SendClientMessage(playerid,grün,"Du hast keine Buslinie ausgewählt.");
RemovePlayerFromVehicle(playerid);
DestroyVehicle(431);
return 1;
}
}
return 1;
}
aber die Checkpoints kommen einfach nicht: -
Guten Morgen
Mein Problem ist nun wie folgt:
Beim Compailen ist mir aufgefallen das Folgende error meldungen kommen:
samplernen.p(1200) : error 029: invalid expression, assumed zero
samplernen.p(1200) : warning 215: expression has no effect
samplernen.p(1200) : error 001: expected token: ";", but found "if"Das bezieht sich auf die 4 Buslinie!!
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") == 1)
{
//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);
}
}
}
else if(GetPVarInt(playerid,"bus_job") == 2)
{
//wenn bus_job ausgeführt wird.
new bID = GetPVarInt(playerid,"bus_cp");
if(IsPlayerInRangeOfPoint(playerid,5,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z]))
{
bID++;
if(bID >= sizeof(bust2cps))
{
GivePlayerMoney(playerid,12000);
SetPVarInt(playerid,"bus_cp",0);
SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 12.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z],5);
}
}
else if (GetPVarInt(playerid,"bus_job") == 3)
{
if(IsPlayerInRangeOfPoint(playerid,5,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z]))
{
bID++;
if(bID >= sizeof(bust3cps))
{
GivePlayerMoney(playerid,15000);
SetPVarInt(playerid,"bus_cp",8);
SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 15.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
}
else if (GetPVarInt(playerid,"bus_job") == 4)
{
if(IsPlayerInRangeOfPoint(playerid,5,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z]))
{
bID++;
if(bID >= sizeof(bust4cps))
{
GivePlayerMoney(playerid,30000);
SetPVarInt(playerid,"bus_cp",8);
SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 30.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
}
}
}
}
}
}
DisablePlayerCheckpoint(playerid);
return 1;
}Ich hoffe man kann mir helfen da ich den fehler einfach nicht finde
ps: Fehler gefunden:
Bei den vorherigen Code:
pwn]samplernen.p(1200) : error 029: invalid expression, assumed zero
samplernen.p(1200) : warning 215: expression has no effect
samplernen.p(1200) : error 001: expected token: ";", but found "if"Das bezieht sich auf die 4 Buslinie!!
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") == 1)
{
//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);
}
}
}
else if(GetPVarInt(playerid,"bus_job") == 2)
{
//wenn bus_job ausgeführt wird.
new bID = GetPVarInt(playerid,"bus_cp");
if(IsPlayerInRangeOfPoint(playerid,5,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z]))
{
bID++;
if(bID >= sizeof(bust2cps))
{
GivePlayerMoney(playerid,12000);
SetPVarInt(playerid,"bus_cp",0);
SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 12.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z],5);
}
}
else if (GetPVarInt(playerid,"bus_job") == 3)
{
if(IsPlayerInRangeOfPoint(playerid,5,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z]))
{
bID++;
if(bID >= sizeof(bust3cps))
{
GivePlayerMoney(playerid,15000);
SetPVarInt(playerid,"bus_cp",8);
SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 15.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
}
else if (GetPVarInt(playerid,"bus_job") == 4)
{
if(IsPlayerInRangeOfPoint(playerid,5,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z]))
{
bID++;
if(bID >= sizeof(bust4cps))
{
GivePlayerMoney(playerid,30000);
SetPVarInt(playerid,"bus_cp",8);
SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 30.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
}
}
}
}
}
}
DisablePlayerCheckpoint(playerid);
return 1;
}war das letze } über DisablePlayerCheckpoint(playerid);
falsch gesetzt was ich nun entfert habe und funktioniert hat.So sieht es jetzt aus:
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") == 1)
{
//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);
}
}
}
else if(GetPVarInt(playerid,"bus_job") == 2)
{
//wenn bus_job ausgeführt wird.
new bID = GetPVarInt(playerid,"bus_cp");
if(IsPlayerInRangeOfPoint(playerid,5,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z]))
{
bID++;
if(bID >= sizeof(bust2cps))
{
GivePlayerMoney(playerid,12000);
SetPVarInt(playerid,"bus_cp",0);
SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 12.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z],5);
}
}
else if (GetPVarInt(playerid,"bus_job") == 3)
{
if(IsPlayerInRangeOfPoint(playerid,5,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z]))
{
bID++;
if(bID >= sizeof(bust3cps))
{
GivePlayerMoney(playerid,15000);
SetPVarInt(playerid,"bus_cp",8);
SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 15.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
}
}
else if(GetPVarInt(playerid,"bus_job") == 4)
{
if(IsPlayerInRangeOfPoint(playerid,5,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z]))
{
bID++;
if(bID >= sizeof(bust4cps))
{
GivePlayerMoney(playerid,30000);
SetPVarInt(playerid,"bus_cp",8);
SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 30.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
}
}
}
}
}
DisablePlayerCheckpoint(playerid);
return 1;
}ps:
Checkpoints werden nicht gezeigt
-
Wenn das Script auf dein eigenen PC-läuft darfst du kein pw angeben da es über die Lokale db deines PCS läuft falls ich mich jetzt nicht vertan habe
-
Also immer
if(GetPVarInt(playerid,"bus_job") == 1)
{
GivePlayerMoney(playerid, Gehalt);
}?
-
-
wo genau unterhalb von
if(strlen(inputtext)>5) ? -
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 5Meine 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
-
if(dialogid==DIALOG_REGISTER)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[128],passwort[35];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>5)
{
//Registrierungsfunktion
mysql_escape_string(inputtext,passwort,dbhandle);
format(query,sizeof(query),"INSERT INTO user (username,passwort) VALUES ('%s',MD5('%s')) ",name,passwort);
mysql_function_query(dbhandle,query,false,"","");
}
else
{
//Kleiner als 4 Zeichen
SendClientMessage(playerid,helblau,"Dein Passwort muss mindestens 6 Zeichen lang sein.");
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Account Erstellung","Gebe bitte nun dein gewünschtes Passwort ein!","Erstellen","Abbrechen");
}
}
else
{
Kick(playerid);
}
return 1; -
Beim Registrieren wird mein Score-Level nicht auf 1 gesetzt und weiss nicht wie ich das nun hinbekommen
-
Guten Abend.
Wenn ich doch im Public von OnPasswordResponse das Level vom Spieler auslese ist das doch so richtig oder?
public OnPasswordResponse(playerid)
{
new num_rows,num_fields;
cache_get_data(num_rows,num_fields,dbhandle);
if(num_rows==1)
{
new LevelScore = sInfo[playerid][level];
SetPlayerScore(playerid,LevelScore);
//passwort Richtig
sInfo[playerid][eingeloggt] = 1;
sInfo[playerid][level] = cache_get_field_content_int(1,"level",dbhandle);
SetPlayerScore(playerid,sInfo[playerid][level]);
sInfo[playerid][db_id] = cache_get_field_content_int(0,"id",dbhandle);
SetPlayerMoney(playerid,cache_get_field_content_int(0,"money",dbhandle));
sInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",dbhandle);
sInfo[playerid][fraktion] = cache_get_field_content_int(0,"fraktion",dbhandle);
sInfo[playerid][rang] = cache_get_field_content_int(0,"rang",dbhandle);
sInfo[playerid][spawnchange]= cache_get_field_content_int(0,"spawnchange",dbhandle);
loadPlayerCars(playerid);}
else
{
//Passwort Falsch
SendClientMessage(playerid,grün,"Du hast dein Passwort falsch eingetippt. Versuche es nochmal!");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gibt bitte dein Passwort ein:","Anmelden","Abbrechen");
}
return 1;
} -
Guten Morgen
Ich habe folgendes problem:
Wenn ich Ingame auf mein Server bin und den befehl /buslinie eintippe um mein Dialog für die Busrouten zu bekommen wird es auch angzeigt nur das problem ist wenn ich die 1Route auswähle zeigt er mir zwar den ersten Marker aber dann auch kein weiter mehr.
Damit ihr ein blick auf den Code werfen könnt:
Enum:
enum bus1Enum{
Float:g_x,
Float:g_y,
Float:g_z
}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;
}OnPlayerEnterCheckpoint:
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;
}zu guter letzt noch der Dialog:
public OnPasswordResponse(playerid)
{
new num_rows,num_fields;
cache_get_data(num_rows,num_fields,dbhandle);
if(num_rows==1)
{
//passwort Richtig
sInfo[playerid][eingeloggt] = 1;
sInfo[playerid][level] = cache_get_field_content_int(0,"level",dbhandle);
SetPlayerScore(playerid,sInfo[playerid][level]);
sInfo[playerid][db_id] = cache_get_field_content_int(0,"id",dbhandle);
SetPlayerMoney(playerid,cache_get_field_content_int(0,"money",dbhandle));
sInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",dbhandle);
sInfo[playerid][fraktion] = cache_get_field_content_int(0,"fraktion",dbhandle);
sInfo[playerid][rang] = cache_get_field_content_int(0,"rang",dbhandle);
sInfo[playerid][spawnchange]= cache_get_field_content_int(0,"spawnchange",dbhandle);
loadPlayerCars(playerid);}
else
{
//Passwort Falsch
SendClientMessage(playerid,grün,"Du hast dein Passwort falsch eingetippt. Versuche es nochmal!");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gibt bitte dein Passwort ein:","Anmelden","Abbrechen");
}
return 1;
}public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==DIALOG_AUTOHAUS)
{
if(response)
{
//Autoverkauf
new id=GetPVarInt(playerid,"buyCarID");
if(GetPlayerMoney(playerid)<ahCars[id][c_preis])
{
SendClientMessage(playerid,gelb,"Du besitzt nicht das benötige Geld für das Fahrzeug");
RemovePlayerFromVehicle(playerid);
return 1;
}
GivePlayerMoney(playerid,-ahCars[id][c_preis]);
createPlayerCar(playerid,ahCars[id][model],ahInfo[ahCars[id][ah_id]][v_x],ahInfo[ahCars[id][ah_id]][v_y],ahInfo[ahCars[id][ah_id]][v_z],ahInfo[ahCars[id][ah_id]][v_r]);
SendClientMessage(playerid,grün,"Sie haben sich erfolgreich ein Fahrzeug gekauft.");
RemovePlayerFromVehicle(playerid);
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,türkis,"Du hast den Kaufvorgang abgebrochen.");}
return 1;
}
if(dialogid==DIALOG_LOGIN)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[128],passwort[35];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>0)
{
mysql_escape_string(inputtext,passwort,dbhandle);
format(query,sizeof(query),"SELECT * FROM user WHERE username='%s' AND passwort=MD5('%s')",name,passwort);
mysql_function_query(dbhandle,query,true,"OnPasswordResponse","i",playerid);
}
else
{
//Keine Eingabe
SendClientMessage(playerid,grün,"Gibt bitte dein Passwort ein.");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gibt bitte dein Passwort ein:","Anmelden","Abbrechen");
}
}
else
{
Kick(playerid);
}
return 1;
}
if(dialogid==DIALOG_REGISTER)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[128],passwort[35];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>5)
{
//Registrierungsfunktion
mysql_escape_string(inputtext,passwort,dbhandle);
format(query,sizeof(query),"INSERT INTO user (username,passwort) VALUES ('%s',MD5('%s')) ",name,passwort);
mysql_function_query(dbhandle,query,false,"","");
}
else
{
//Kleiner als 4 Zeichen
SendClientMessage(playerid,helblau,"Dein Passwort muss mindestens 6 Zeichen lang sein.");
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Account Erstellung","Gebe bitte nun dein gewünschtes Passwort ein!","Erstellen","Abbrechen");
}
}
else
{
Kick(playerid);
}
return 1;
}
if(dialogid==DIALOG_TELEPORT)
{
if(response)
{
if(listitem==0)
{
//Autohaus
SetPlayerPos(playerid,2502.1106,1706.7172,10.8203);
SetPlayerFacingAngle(playerid,95.2747);
}
}
else
{
SendClientMessage(playerid,rot,"Vorgang abgebrochen.");
}
return 1;
}
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;
}da ich einfach den Fehler nicht finde brauche ich eure hilfe
-
Guten Abend.
Ich habe mich gefragt wie man eine Staatskasse erstellen kann in MySQL und von da der job Lohn gezahlt wird. Ich habe kein ordentlichen Beitrag finden.
Wäre euch dankbar wenn man mir helfen könnte
-
Kaliber hier von mein script der public: Checkpoints:
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[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 6.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
}
return 1;
}
}
DisablePlayerCheckpoint(playerid);
return 1;
} -
also einfach nur
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[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 6.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
}
return 1;
}
}die Koordinaten von
SetPlayerCheckpoint(playerid,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z],5);nutzen? -
Mein Dialog für den Bus sieht so aus:
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 bist nicht beim Busfahrerpunkt.");}
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 bist nicht beim Busfahrerpunkt.");}
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 bist nicht beim Busfahrerpunkt.");
}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 bist nicht beim Busfahrerpunkt.");
}
}
else
{
SendClientMessage(playerid,grün,"Du hast keine Buslinie ausgewählt.");
RemovePlayerFromVehicle(playerid);
DestroyVehicle(431);
return 1;
}
}aber es werden keine Checkpoints angezeigt ich weiss nicht wieso
-
Du hast mir doch um 21:48 folgendes geschrieben:
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 bist nicht beim Busfahrerpunkt.");}
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 bist nicht beim Busfahrerpunkt.");}
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 bist nicht beim Busfahrerpunkt.");
}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 bist nicht beim Busfahrerpunkt.");
}
}
else
{
SendClientMessage(playerid,grün,"Du hast keine Buslinie ausgewählt.");
RemovePlayerFromVehicle(playerid);
Destroyvehcle(431);
return 1;
}
}Und das verurrsacht mir nur porbleme da man keine Checkpoints bekommt. Da ich nur Listitem=0 besitze da ich für die anderen Routen noch keine Koordinaten haben kann ich die anderen auch nicht befüllen.
Ich habe nur vom Dialog momentan: if(listitem== 0)
{
if(!IsPlayerInRangeOfPoint(playerid,5,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return
SendClientMessage(playerid,helblau,"Du bist nicht beim Busfahrerpunkt.");}