Es wurde kein Fahrzeug gespeichert, also entweder hast du kein Fahrzeug erstellt, oder die Speicherfunktion funktioniert nicht, oder das erstellen des Fahrzeugs geht nicht mehr (dann hast du da was geändert).
Versuche es nochmal, dann siehst du ja ob das Fahrzeug gespeichert wird.
Wenn nicht, poste bitte den Code mit dem du das Fahrzeug erstellst/kaufst und den mit dem du es speicherst, so wie der Code jetzt ist, denn das hatte bereits funktioniert.
Car System bugt.
- Corvus
- Geschlossen
- Erledigt
Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!
Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
-
-
Das Car wird in der Datenbank erstellt aber überall 0
Code:Hier gekauft:
if(strcmp("/buycar", cmd, true) == 0)
{
if(Spectating[playerid] != -1)
{
if(Carlist[playerid][CarKey[playerid]][Typ] == -1)
{
new preis = Kaufliste[Spectating[playerid]][Preis];
if(preis <= PlayerInfo[playerid][pCash])
{
new VID = GetPlayerVehicleID(playerid);
new autohaus = Kaufliste[Spectating[playerid]][Autohaus];
GivePlayerMoneys(playerid, - preis);
Carlist[playerid][CarKey[playerid]][Typ] = GetVehicleModel(GetPlayerVehicleID(playerid));
Carlist[playerid][CarKey[playerid]][pos_x] = Autospawns[autohaus][pos_x];
Carlist[playerid][CarKey[playerid]][pos_y] = Autospawns[autohaus][pos_y];
Carlist[playerid][CarKey[playerid]][pos_z] = Autospawns[autohaus][pos_z];
Carlist[playerid][CarKey[playerid]][z_angle] = Autospawns[autohaus][z_angle];
Carlist[playerid][CarKey[playerid]][SpawnSaveX] = Autospawns[autohaus][pos_x];
Carlist[playerid][CarKey[playerid]][SpawnSaveY] = Autospawns[autohaus][pos_y];
Carlist[playerid][CarKey[playerid]][SpawnSaveZ] = Autospawns[autohaus][pos_z];
Carlist[playerid][CarKey[playerid]][SpawnSaveRot] = Autospawns[autohaus][z_angle];
Carlist[playerid][CarKey[playerid]][Status] = 0;
Carlist[playerid][CarKey[playerid]][Lock] = 0;
Carlist[playerid][CarKey[playerid]][ingarage] = 0;
Carlist[playerid][CarKey[playerid]][TankVolumen] = vehTank[GetVehicleModel(VID)-400];
Carlist[playerid][CarKey[playerid]][Carid] = CreateTunedCar(playerid, CarKey[playerid]);
Kilometer[Carlist[playerid][CarKey[playerid]][Carid]] = 0;
Gas[Carlist[playerid][CarKey[playerid]][Carid]] = Carlist[playerid][CarKey[playerid]][TankVolumen];
SetPlayerCheckpoint(playerid,Carlist[playerid][CarKey[playerid]][pos_x],Carlist[playerid][CarKey[playerid]][pos_y],Carlist[playerid][CarKey[playerid]][pos_z],10.0);
new query[900], h = CarKey[playerid];
format(query,sizeof(query),"INSERT INTO `cars` (`sqlid`,`carkey`,`ingarage`,`AH_Typ`,`AH_X`,`AH_Y`,`AH_Z`,`AH_Rot`,`AH_Status`,`AH_Lock`,`AH_Paintjob`,`AH_Farbe1`,`AH_Farbe2`,`AH_Mod1`,`AH_Mod2`,`AH_Mod3`,`AH_Mod4`,`AH_Mod5`,`AH_Mod6`,`AH_Mod7`,`AH_Mod8`,`AH_Mod9`,`AH_Mod10`,`AH_Mod11`,`AH_Mod12`,`AH_Mod13`,`AH_Mod14`,`AH_Mod15`,`AH_Mod16`,`AH_Mod17`,");
format(query,sizeof(query),"%s`AH_SpawnSaveX`,`AH_SpawnSaveY`,`AH_SpawnSaveZ`,`AH_SpawnSaveRot`,`AH_TankVolumen`,`AH_Mats`,`AH_Neon`,`AH_NeonType`,`AH_Drugs`,`AH_StandTime`,`AH_Meter`) VALUES (%d,%d,%i,%i,%f,%f,%f,%f,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%f,%f,%f,%f,%i,%i,%i,%i,%i,%i,%i)",
query,PlayerInfo[playerid][pSQLID],h,Carlist[playerid][h][ingarage],Carlist[playerid][h][Typ],Carlist[playerid][h][pos_x],Carlist[playerid][h][pos_y],Carlist[playerid][h][pos_z],
Carlist[playerid][h][z_angle],Carlist[playerid][h][Status],Carlist[playerid][h][Lock],Carlist[playerid][h][Paintjob],
Carlist[playerid][h][Farbe1],Carlist[playerid][h][Farbe2],Carlist[playerid][h][mod1],Carlist[playerid][h][mod2],
Carlist[playerid][h][mod3],Carlist[playerid][h][mod4],Carlist[playerid][h][mod5],Carlist[playerid][h][mod6],
Carlist[playerid][h][mod7],Carlist[playerid][h][mod8],Carlist[playerid][h][mod9],Carlist[playerid][h][mod10],
Carlist[playerid][h][mod11],Carlist[playerid][h][mod12],Carlist[playerid][h][mod13],Carlist[playerid][h][mod14],
Carlist[playerid][h][mod15],Carlist[playerid][h][mod16],Carlist[playerid][h][mod17],
Carlist[playerid][h][SpawnSaveX],Carlist[playerid][h][SpawnSaveY],Carlist[playerid][h][SpawnSaveZ],
Carlist[playerid][h][SpawnSaveRot],Carlist[playerid][h][TankVolumen],Carlist[playerid][h][cMats],
Carlist[playerid][h][Neon],Carlist[playerid][h][NeonType],Carlist[playerid][h][cDrugs],Carlist[playerid][h][StandTime],
Kilometer[Carlist[playerid][h][CarID]]);
mysql_query(query);
ForAllPlayers(i){
if(IsPlayerConnected(i)){
SetVehicleParamsForPlayer(Kaufliste[Spectating[playerid]][Carid], i, 0, 0);
print("OnPlayerDeath: message sent13");
}}
TogglePlayerControllable(playerid,1);
RemovePlayerFromVehicle(playerid);
format(string, sizeof(string), "Du hast dir erfolgreich für %s$ ein/einen %s gekauft!",GetPoint(preis),Kaufliste[Spectating[playerid]][Name]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "öffnen und Schließen kannst du es mit /lock und /carlock.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Mehr Befehle kannst du unter /carhelp sehen.");
SendClientMessage(playerid, COLOR_YELLOW, "Dein Auto steht am Ausgabepunkt(Roter Marker) bereit! Viel Spaß beim Fahren!");
GetPlayerName(playerid, sendername, sizeof(sendername));
if(Kaufliste[Spectating[playerid]][Autohaus] == 2)
{
BizInfo[13][bTill] += (preis/100)*19;
}
Spectating[playerid] = -1;
}
else
{
format(string, sizeof(string), " Du hast nicht genug Geld für das Auto (benötigt: $%i)!", preis);
SendClientMessage(playerid, COLOR_ERRORTEXT, string);
}
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Du besitzt bereits ein Auto auf dem ausgewählten Schlüssel!");
}
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Du besichtigst kein Auto !");
}
return 1;
}Hier Createt:
public CreateTunedCar(playerid, CarKey1)
{
printf("ingarage=%i",Carlist[playerid][CarKey1][ingarage]);
if(IsPlayerConnected(playerid) && Carlist[playerid][CarKey1][Typ] != -1)
{
printf("ingarage=%i",Carlist[playerid][CarKey1][ingarage]);
if(Carlist[playerid][CarKey1][ingarage] == 1) return 1;
new carid = CreateVehicle(Carlist[playerid][CarKey1][Typ],Carlist[playerid][CarKey1][pos_x],Carlist[playerid][CarKey1][pos_y],Carlist[playerid][CarKey1][pos_z],Carlist[playerid][CarKey1][z_angle],-1,-1,-1);
Carlist[playerid][CarKey1][CarID] = carid;
printf("carid = %d", carid);
new string[50];
format(string, sizeof(string), "{FFFF00}E-RP-{21DD00}%d", carid);
printf("string=%s", string);
SetVehicleNumberPlate(carid,string);
Gas[carid] = Carlist[playerid][CarKey1][TankVolumen];
printf("Gas: %d", Gas[carid]);
Locked[carid] = Carlist[playerid][CarKey1][Lock];
printf("Locked: %d", Locked[carid]);
if(Carlist[playerid][CarKey1][Lock] == 1)
{
ForAllPlayers(i)
{
SetVehicleParamsForPlayer(carid,i,0,1);
}
}
printf("Vor components");
if(Carlist[playerid][CarKey1][mod1]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod1]); }
if(Carlist[playerid][CarKey1][mod2]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod2]); }
if(Carlist[playerid][CarKey1][mod3]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod3]); }
if(Carlist[playerid][CarKey1][mod4]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod4]); }
if(Carlist[playerid][CarKey1][mod5]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod5]); }
if(Carlist[playerid][CarKey1][mod6]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod6]); }
if(Carlist[playerid][CarKey1][mod7]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod7]); }
if(Carlist[playerid][CarKey1][mod8]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod8]); }
if(Carlist[playerid][CarKey1][mod9]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod9]); }
if(Carlist[playerid][CarKey1][mod10]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod10]); }
if(Carlist[playerid][CarKey1][mod11]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod11]); }
if(Carlist[playerid][CarKey1][mod12]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod12]); }
if(Carlist[playerid][CarKey1][mod13]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod13]); }
if(Carlist[playerid][CarKey1][mod14]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod14]); }
if(Carlist[playerid][CarKey1][mod15]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod15]); }
if(Carlist[playerid][CarKey1][mod16]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod16]); }
if(Carlist[playerid][CarKey1][mod17]!=-1) { AddVehicleComponent(carid,Carlist[playerid][CarKey1][mod17]); }
if(Carlist[playerid][CarKey1][Paintjob]!=-1) { ChangeVehiclePaintjob(carid,Carlist[playerid][CarKey1][Paintjob]); }
if(Carlist[playerid][CarKey1][Farbe1]!=-1) { ChangeVehicleColor(carid,Carlist[playerid][CarKey1][Farbe1],Carlist[playerid][CarKey1][Farbe2]); }
printf("Nach components");
for(new i; i<MaxVeh[playerid]; i++)
{
printf("i:%d", i);
if(Carlist[playerid][i][Neon]!=0)
{
printf("Neon: %d", Carlist[playerid][i][NeonType]);
switch(Carlist[playerid][i][NeonType])
{
case 0:AttachObjectToVehicle(CreateObject(18647,0,0,0,0,0,0), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0), AttachObjectToVehicle(CreateObject(18647,0,0,0,0,0,0), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
case 1:AttachObjectToVehicle(CreateObject(18648,0,0,0,0,0,0), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0), AttachObjectToVehicle(CreateObject(18648,0,0,0,0,0,0), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
case 2:AttachObjectToVehicle(CreateObject(18649,0,0,0,0,0,0), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0), AttachObjectToVehicle(CreateObject(18649,0,0,0,0,0,0), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
case 3:AttachObjectToVehicle(CreateObject(18650,0,0,0,0,0,0), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0), AttachObjectToVehicle(CreateObject(18650,0,0,0,0,0,0), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
case 4:AttachObjectToVehicle(CreateObject(18651,0,0,0,0,0,0), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0), AttachObjectToVehicle(CreateObject(18651,0,0,0,0,0,0), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
case 5:AttachObjectToVehicle(CreateObject(18652,0,0,0,0,0,0), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0), AttachObjectToVehicle(CreateObject(18652,0,0,0,0,0,0), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
}
}
}
printf("returning: %d", carid);
return carid;
}
printf("returning: error -1");
return -1;
}Dann noch gespeichert:
public PlayerCarDisconnect(playerid)
{
if(IsPlayerNPC(playerid)){
return 1;
}
for(new h = 0; h < MaxVeh[playerid]; h++)
{
if(Carlist[playerid][h][Carid] != -1)
{
GetVehiclePos(Carlist[playerid][h][Carid], Carlist[playerid][h][SpawnSaveX], Carlist[playerid][h][SpawnSaveY], Carlist[playerid][h][SpawnSaveZ]);
GetVehicleZAngle(Carlist[playerid][h][Carid], Carlist[playerid][h][SpawnSaveRot]);
Carlist[playerid][h][TankVolumen] = Gas[Carlist[playerid][h][Carid]];
ForAllPlayers(i)
{
SetVehicleParamsForPlayer(Carlist[playerid][h][Carid],i,0,0);
}
DestroyVehicleSelfmade(Carlist[playerid][h][Carid]);
Carlist[playerid][h][Carid] = -1;
}
}
PlayerCarUpdate(playerid);
if(Spectating[playerid] != -1){
ForAllPlayers(i){
SetVehicleParamsForPlayer(Kaufliste[Spectating[playerid]][Carid],i,0,0);
}
Spectating[playerid] = -1;
}
return 1;
}public PlayerCarUpdate(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
new string[2048], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
for(new h = 0; h < MaxVeh[playerid]; h++)
{
format(string, sizeof(string), "UPDATE `cars` SET `ingarage`=%i,`AH_Typ`=%i,`AH_X`='%f',`AH_Y`='%f',`AH_Z`='%f',`AH_Rot`='%f',`AH_Status`=%i,`AH_Lock`=%i,`AH_Paintjob`=%i,`AH_Farbe1`=%i,`AH_Farbe2`=%i,`AH_mod1`=%i,`AH_mod2`=%i,`AH_mod3`=%i,`AH_mod4`=%i,`AH_mod5`=%i,`AH_mod6`=%i,`AH_mod7`=%i,`AH_mod8`=%i,`AH_mod9`=%i,`AH_mod10`=%i,`AH_mod11`=%i,`AH_mod12`=%i,`AH_mod13`=%i,`AH_mod14`=%i,`AH_mod15`=%i,`AH_mod16`=%i,`AH_mod17`=%i,",
Carlist[playerid][h][ingarage],Carlist[playerid][h][Typ],Carlist[playerid][h][pos_x],Carlist[playerid][h][pos_y],Carlist[playerid][h][pos_z],
Carlist[playerid][h][z_angle],Carlist[playerid][h][Status],Carlist[playerid][h][Lock],Carlist[playerid][h][Paintjob],
Carlist[playerid][h][Farbe1],Carlist[playerid][h][Farbe2],Carlist[playerid][h][mod1],Carlist[playerid][h][mod2],
Carlist[playerid][h][mod3],Carlist[playerid][h][mod4],Carlist[playerid][h][mod5],Carlist[playerid][h][mod6],
Carlist[playerid][h][mod7],Carlist[playerid][h][mod8],Carlist[playerid][h][mod9],Carlist[playerid][h][mod10],
Carlist[playerid][h][mod11],Carlist[playerid][h][mod12],Carlist[playerid][h][mod13],Carlist[playerid][h][mod14],
Carlist[playerid][h][mod15],Carlist[playerid][h][mod16],Carlist[playerid][h][mod17]);format(string, sizeof(string),"%s`AH_SpawnSaveX`=%f,`AH_SpawnSaveY`='%f',`AH_SpawnSaveZ`='%f',`AH_SpawnSaveRot`='%f',`AH_TankVolumen`=%i,`AH_Mats`=%i,`AH_Neon`=%i,`AH_NeonType`=%i,`AH_Drugs`=%i,`AH_StandTime`=%i,`AH_Meter`=%i WHERE `sqlid`=%i AND `carkey`=%i",
string, Carlist[playerid][h][SpawnSaveX],Carlist[playerid][h][SpawnSaveY],Carlist[playerid][h][SpawnSaveZ],
Carlist[playerid][h][SpawnSaveRot],Carlist[playerid][h][TankVolumen],Carlist[playerid][h][cMats],
Carlist[playerid][h][Neon],Carlist[playerid][h][NeonType],Carlist[playerid][h][cDrugs],Carlist[playerid][h][StandTime],
Kilometer[Carlist[playerid][h][CarID]],PlayerInfo[playerid][pSQLID],h);self_mysql_query(string);
}
return 1;
} -
Was steht im Log, wenn du den Befehl so einfügst und eingibst?
if(strcmp("/buycar", cmd, true) == 0)
{
if(Spectating[playerid] != -1)
{
if(Carlist[playerid][CarKey[playerid]][Typ] == -1)
{
new preis = Kaufliste[Spectating[playerid]][Preis];
if(preis <= PlayerInfo[playerid][pCash])
{
new VID = GetPlayerVehicleID(playerid);
printf("vid: %d", VID);
new autohaus = Kaufliste[Spectating[playerid]][Autohaus];
printf("autohaus: %d", autohaus);
GivePlayerMoneys(playerid, - preis);
Carlist[playerid][CarKey[playerid]][Typ] = GetVehicleModel(GetPlayerVehicleID(playerid));
printf("Model: %d", Carlist[playerid][CarKey[playerid]][Typ]);
Carlist[playerid][CarKey[playerid]][pos_x] = Autospawns[autohaus][pos_x];
Carlist[playerid][CarKey[playerid]][pos_y] = Autospawns[autohaus][pos_y];
Carlist[playerid][CarKey[playerid]][pos_z] = Autospawns[autohaus][pos_z];
printf("pos: %f / %f / %f", Autospawns[autohaus][pos_x], Autospawns[autohaus][pos_y], Autospawns[autohaus][pos_z]);
printf("pos: %f / %f / %f", Carlist[playerid][CarKey[playerid]][pos_x], Carlist[playerid][CarKey[playerid]][pos_y], Carlist[playerid][CarKey[playerid]][pos_z]);
Carlist[playerid][CarKey[playerid]][z_angle] = Autospawns[autohaus][z_angle];
Carlist[playerid][CarKey[playerid]][SpawnSaveX] = Autospawns[autohaus][pos_x];
Carlist[playerid][CarKey[playerid]][SpawnSaveY] = Autospawns[autohaus][pos_y];
Carlist[playerid][CarKey[playerid]][SpawnSaveZ] = Autospawns[autohaus][pos_z];
Carlist[playerid][CarKey[playerid]][SpawnSaveRot] = Autospawns[autohaus][z_angle];
Carlist[playerid][CarKey[playerid]][Status] = 0;
Carlist[playerid][CarKey[playerid]][Lock] = 0;
Carlist[playerid][CarKey[playerid]][ingarage] = 0;
Carlist[playerid][CarKey[playerid]][TankVolumen] = vehTank[GetVehicleModel(VID)-400];
Carlist[playerid][CarKey[playerid]][Carid] = CreateTunedCar(playerid, CarKey[playerid]);
Kilometer[Carlist[playerid][CarKey[playerid]][Carid]] = 0;
Gas[Carlist[playerid][CarKey[playerid]][Carid]] = Carlist[playerid][CarKey[playerid]][TankVolumen];
SetPlayerCheckpoint(playerid,Carlist[playerid][CarKey[playerid]][pos_x],Carlist[playerid][CarKey[playerid]][pos_y],Carlist[playerid][CarKey[playerid]][pos_z],10.0);
new query[900], h = CarKey[playerid];
format(query,sizeof(query),"INSERT INTO `cars` (`sqlid`,`carkey`,`ingarage`,`AH_Typ`,`AH_X`,`AH_Y`,`AH_Z`,`AH_Rot`,`AH_Status`,`AH_Lock`,`AH_Paintjob`,`AH_Farbe1`,`AH_Farbe2`,`AH_Mod1`,`AH_Mod2`,`AH_Mod3`,`AH_Mod4`,`AH_Mod5`,`AH_Mod6`,`AH_Mod7`,`AH_Mod8`,`AH_Mod9`,`AH_Mod10`,`AH_Mod11`,`AH_Mod12`,`AH_Mod13`,`AH_Mod14`,`AH_Mod15`,`AH_Mod16`,`AH_Mod17`,");
format(query,sizeof(query),"%s`AH_SpawnSaveX`,`AH_SpawnSaveY`,`AH_SpawnSaveZ`,`AH_SpawnSaveRot`,`AH_TankVolumen`,`AH_Mats`,`AH_Neon`,`AH_NeonType`,`AH_Drugs`,`AH_StandTime`,`AH_Meter`) VALUES (%d,%d,%i,%i,%f,%f,%f,%f,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%f,%f,%f,%f,%i,%i,%i,%i,%i,%i,%i)",
query,PlayerInfo[playerid][pSQLID],h,Carlist[playerid][h][ingarage],Carlist[playerid][h][Typ],Carlist[playerid][h][pos_x],Carlist[playerid][h][pos_y],Carlist[playerid][h][pos_z],
Carlist[playerid][h][z_angle],Carlist[playerid][h][Status],Carlist[playerid][h][Lock],Carlist[playerid][h][Paintjob],
Carlist[playerid][h][Farbe1],Carlist[playerid][h][Farbe2],Carlist[playerid][h][mod1],Carlist[playerid][h][mod2],
Carlist[playerid][h][mod3],Carlist[playerid][h][mod4],Carlist[playerid][h][mod5],Carlist[playerid][h][mod6],
Carlist[playerid][h][mod7],Carlist[playerid][h][mod8],Carlist[playerid][h][mod9],Carlist[playerid][h][mod10],
Carlist[playerid][h][mod11],Carlist[playerid][h][mod12],Carlist[playerid][h][mod13],Carlist[playerid][h][mod14],
Carlist[playerid][h][mod15],Carlist[playerid][h][mod16],Carlist[playerid][h][mod17],
Carlist[playerid][h][SpawnSaveX],Carlist[playerid][h][SpawnSaveY],Carlist[playerid][h][SpawnSaveZ],
Carlist[playerid][h][SpawnSaveRot],Carlist[playerid][h][TankVolumen],Carlist[playerid][h][cMats],
Carlist[playerid][h][Neon],Carlist[playerid][h][NeonType],Carlist[playerid][h][cDrugs],Carlist[playerid][h][StandTime],
Kilometer[Carlist[playerid][h][CarID]]);
mysql_query(query);
printf("query: %s", query);
ForAllPlayers(i)
{
if(IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(Kaufliste[Spectating[playerid]][Carid], i, 0, 0);
print("OnPlayerDeath: message sent13");
}
}
TogglePlayerControllable(playerid,1);
RemovePlayerFromVehicle(playerid);
format(string, sizeof(string), "Du hast dir erfolgreich für %s$ ein/einen %s gekauft!",GetPoint(preis),Kaufliste[Spectating[playerid]][Name]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "öffnen und Schließen kannst du es mit /lock und /carlock.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Mehr Befehle kannst du unter /carhelp sehen.");
SendClientMessage(playerid, COLOR_YELLOW, "Dein Auto steht am Ausgabepunkt(Roter Marker) bereit! Viel Spaß beim Fahren!");
GetPlayerName(playerid, sendername, sizeof(sendername));
if(Kaufliste[Spectating[playerid]][Autohaus] == 2)
{
BizInfo[13][bTill] += (preis/100)*19;
}
Spectating[playerid] = -1;
}
else
{
format(string, sizeof(string), " Du hast nicht genug Geld für das Auto (benötigt: $%i)!", preis);
SendClientMessage(playerid, COLOR_ERRORTEXT, string);
}
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Du besitzt bereits ein Auto auf dem ausgewählten Schlüssel!");
}
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Du besichtigst kein Auto !");
}
return 1;
} -
Folgendes:
[19:36:27] vid: 135
[19:36:27] autohaus: 0
[19:36:27] Model: 516
[19:36:27] pos: 748.975219 / -1345.818237 / 13.515500
[19:36:27] pos: 748.975219 / -1345.818237 / 13.515500
[19:36:27] ingarage=0
[19:36:27] ingarage=0
[19:36:27] carid = 222
[19:36:27] string={FFFF00}E-RP-{21DD00}222
[19:36:27] Gas: 100
[19:36:27] Locked: 0
[19:36:27] Vor components
[19:36:27] Nach components
[19:36:27] i:0
[19:36:27] i:1
[19:36:27] i:2
[19:36:27] returning: 222
[19:36:27] query: INSERT INTO `cars` (`sqlid`,`carkey`,`ingarage`,`AH_Typ`,`AH_X`,`AH_Y`,`AH_Z`,`AH_Rot`,`AH_Status`,`AH_Lock`,`AH_Paintjob`,`AH_Farbe1`,`AH_Farbe2`,`AH_Mod1`,`AH_Mod2`,`AH_Mod3`,`AH_Mod4`,`AH_Mod5`,`AH_Mod6`,`AH_Mod7`,`AH_Mod8`,`AH_Mod9`,`AH_Mod10`,`AH_Mod11`,`AH_Mod12`,`AH_Mod13`,`AH_Mod14`,`AH_Mod15`,`AH_Mod16`,`AH_Mod17`,`AH_SpawnSaveX`,`AH_SpawnSaveY`,`AH_SpawnSaveZ`,`AH_SpawnSaveRot`,`AH_TankVolumen`,`AH_Mats`,`AH_Neon`,`AH_NeonType`,`AH_Drugs`,`AH_StandTime`,`AH_Meter`) VALUES (1,0,0,516,748.975219,-1345.818237,13.515500,270.000000,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,748.975219,-1345.818237,13.515500,270.000000,100,0,0,0,0,0,0)
[19:36:27] OnPlayerDeath: message sent13 -
Also, dann wird es doch richtig in die Datenbank eingetragen, die Werte stehen doch alle richtig im Query.
Zitat[19:36:27] query: INSERT INTO `cars` (`sqlid`,`carkey`,`ingarage`,`AH_Typ`,`AH_X`,`AH_Y`,`AH_Z`,`AH_Rot`,`AH_Status`,`AH_Lock`,`AH_Paintjob`,`AH_Farbe1`,`AH_Farbe2`,`AH_Mod1`,`AH_Mod2`,`AH_Mod3`,`AH_Mod4`,`AH_Mod5`,`AH_Mod6`,`AH_Mod7`,`AH_Mod8`,`AH_Mod9`,`AH_Mod10`,`AH_Mod11`,`AH_Mod12`,`AH_Mod13`,`AH_Mod14`,`AH_Mod15`,`AH_Mod16`,`AH_Mod17`,`AH_SpawnSaveX`,`AH_SpawnSaveY`,`AH_SpawnSaveZ`,`AH_SpawnSaveRot`,`AH_TankVolumen`,`AH_Mats`,`AH_Neon`,`AH_NeonType`,`AH_Drugs`,`AH_StandTime`,`AH_Meter`) VALUES (1,0,0,516,748.975219,-1345.818237,13.515500,270.000000,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,748.975219,-1345.818237,13.515500,270.000000,100,0,0,0,0,0,0)
-
Ja das Car wird 2 mal erstellt und beim relogg ist es nicht da.
-
Also, in der Datenbak steht es richtig jetzt? JA oder NEIN?
Wenn ja:
Poste den Code mit dem du das Fahrzeug lädst wenn man connected UND den MySQL Log der kommt, wenn das Fahrzeug versucht wird geladen zu werden.Wenn nein:
Was ist falsch? -
Car wird gespeichert jedoch nicht geladen Code:
public PlayerCarConnect(playerid)
{
if(IsPlayerNPC(playerid))
{
return 1;
}
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
for(new h = 0; h < MaxVeh[playerid]; h++)
{
new data[100],TextString[50];
format(TextString, sizeof(TextString), "SELECT * FROM `cars` WHERE `sqlid`=%i AND `carkey`=%d", PlayerInfo[playerid][pSQLID], h);
self_mysql_query(TextString);
mysql_store_result(MySQLConnection);
if(mysql_num_rows(MySQLConnection) != 0)
{
mysql_fetch_row_format(TextString);
self_mysql_get_field("id", data); Carlist[playerid][h][cid] = strval( data );
self_mysql_get_field("sqlid", data); Carlist[playerid][h][sqlid] = strval( data );
self_mysql_get_field("ingarage", data); Carlist[playerid][h][ingarage] = strval( data );
self_mysql_get_field("AH_Typ", data); Carlist[playerid][h][Typ] = strval( data );
self_mysql_get_field("AH_X", data); Carlist[playerid][h][pos_x] = floatstr( data );
self_mysql_get_field("AH_Y", data); Carlist[playerid][h][pos_y] = floatstr( data );
self_mysql_get_field("AH_Z", data); Carlist[playerid][h][pos_z] = floatstr( data );
self_mysql_get_field("AH_Rot", data); Carlist[playerid][h][z_angle] = floatstr( data );
self_mysql_get_field("AH_Status", data); Carlist[playerid][h][Status] = strval( data );
self_mysql_get_field("AH_Lock", data); Carlist[playerid][h][Lock] = strval( data );
self_mysql_get_field("AH_Paintjob", data); Carlist[playerid][h][Paintjob] = strval( data );
self_mysql_get_field("AH_Farbe1", data); Carlist[playerid][h][Farbe1] = strval( data );
self_mysql_get_field("AH_Farbe2", data); Carlist[playerid][h][Farbe2] = strval( data );
self_mysql_get_field("AH_mod1", data); Carlist[playerid][h][mod1] = strval( data );
self_mysql_get_field("AH_mod2", data); Carlist[playerid][h][mod2] = strval( data );
self_mysql_get_field("AH_mod3", data); Carlist[playerid][h][mod3] = strval( data );
self_mysql_get_field("AH_mod4", data); Carlist[playerid][h][mod4] = strval( data );
self_mysql_get_field("AH_mod5", data); Carlist[playerid][h][mod5] = strval( data );
self_mysql_get_field("AH_mod6", data); Carlist[playerid][h][mod6] = strval( data );
self_mysql_get_field("AH_mod7", data); Carlist[playerid][h][mod7] = strval( data );
self_mysql_get_field("AH_mod8", data); Carlist[playerid][h][mod8] = strval( data );
self_mysql_get_field("AH_mod9", data); Carlist[playerid][h][mod9] = strval( data );
self_mysql_get_field("AH_mod10", data); Carlist[playerid][h][mod10] = strval( data );
self_mysql_get_field("AH_mod11", data); Carlist[playerid][h][mod11] = strval( data );
self_mysql_get_field("AH_mod12", data); Carlist[playerid][h][mod12] = strval( data );
self_mysql_get_field("AH_mod13", data); Carlist[playerid][h][mod13] = strval( data );
self_mysql_get_field("AH_mod14", data); Carlist[playerid][h][mod14] = strval( data );
self_mysql_get_field("AH_mod15", data); Carlist[playerid][h][mod15] = strval( data );
self_mysql_get_field("AH_mod16", data); Carlist[playerid][h][mod16] = strval( data );
self_mysql_get_field("AH_mod17", data); Carlist[playerid][h][mod17] = strval( data );
self_mysql_get_field("AH_SpawnSaveX", data); Carlist[playerid][h][SpawnSaveX] = floatstr( data );
self_mysql_get_field("AH_SpawnSaveY", data); Carlist[playerid][h][SpawnSaveY] = floatstr( data );
self_mysql_get_field("AH_SpawnSaveZ", data); Carlist[playerid][h][SpawnSaveZ] = floatstr( data );
self_mysql_get_field("AH_SpawnSaveRot", data); Carlist[playerid][h][SpawnSaveRot] = floatstr( data );
self_mysql_get_field("AH_TankVolumen", data); Carlist[playerid][h][TankVolumen] = strval( data );
self_mysql_get_field("AH_Mats", data); Carlist[playerid][h][cMats] = strval(data);
self_mysql_get_field("AH_Neon", data); Carlist[playerid][h][Neon] = strval(data);
self_mysql_get_field("AH_NeonType", data); Carlist[playerid][h][NeonType] = strval(data);
self_mysql_get_field("AH_Drugs", data); Carlist[playerid][h][cDrugs] = strval(data);
self_mysql_get_field("AH_StandTime", data); Carlist[playerid][h][StandTime] = strval(data);
self_mysql_get_field("AH_Meter", data); Kilometer[Carlist[playerid][h][h]] = strval(data);
Carlist[playerid][h][Carid] = CreateTunedCar(playerid, h);
if(Carlist[playerid][h][Typ] != -1 && Carlist[playerid][h][Status] == 0){
printf("Fahrzeugspeicherung: Beginning Spawn.");
printf("Fahrzeugspeicherung: End Spawn.");}
printf("(%d,%d,%i,%i,%f,%f,%f,%f,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%f,%f,%f,%f,%i,%i,%i,%i,%i,%i,%f)",
PlayerInfo[playerid][pSQLID],h,Carlist[playerid][h][ingarage],Carlist[playerid][h][Typ],Carlist[playerid][h][pos_x],Carlist[playerid][h][pos_y],Carlist[playerid][h][pos_z],
Carlist[playerid][h][z_angle],Carlist[playerid][h][Status],Carlist[playerid][h][Lock],Carlist[playerid][h][Paintjob],
Carlist[playerid][h][Farbe1],Carlist[playerid][h][Farbe2],Carlist[playerid][h][mod1],Carlist[playerid][h][mod2],
Carlist[playerid][h][mod3],Carlist[playerid][h][mod4],Carlist[playerid][h][mod5],Carlist[playerid][h][mod6],
Carlist[playerid][h][mod7],Carlist[playerid][h][mod8],Carlist[playerid][h][mod9],Carlist[playerid][h][mod10],
Carlist[playerid][h][mod11],Carlist[playerid][h][mod12],Carlist[playerid][h][mod13],Carlist[playerid][h][mod14],
Carlist[playerid][h][mod15],Carlist[playerid][h][mod16],Carlist[playerid][h][mod17],
Carlist[playerid][h][SpawnSaveX],Carlist[playerid][h][SpawnSaveY],Carlist[playerid][h][SpawnSaveZ],
Carlist[playerid][h][SpawnSaveRot],Carlist[playerid][h][TankVolumen],Carlist[playerid][h][cMats],
Carlist[playerid][h][Neon],Carlist[playerid][h][NeonType],Carlist[playerid][h][cDrugs],Carlist[playerid][h][StandTime],
Kilometer[Carlist[playerid][h][CarID]]);
}
}
return 1;
}Mysql Log:
[20:44:41] CMySQLHandler::Query(UPDATE `cars` SET `ingarage`=0,`AH_Typ`=-1,`AH_X`='0.000000',`AH_Y`='0.000000',`AH_Z`='0.000000',`AH_Rot`='0.000000',`AH_Status`=0,`AH_Lock`=0,`AH_Paintjob`=-1,`AH_Farbe1`=-1,`AH_Farbe2`=-1,`AH_mod1`=-1,`AH_mod2`=-1,`AH_mod3`=-1,`AH_mod4`=-1,`AH_mod5`=-1,`AH_mod6`=-1,`AH_mod7`=-1,`AH_mod8`=-1,`AH_mod9`=-1,`AH_mod10`=-1,`AH_mod11`=-1,`AH_mod12`=-1,`AH_mod13`=-1,`AH_mod14`=-1,`AH_mod15`=-1,`AH_mod16`=-1,`AH_mod17`=-1,`AH_SpawnSaveX`=0.000000,`AH_SpawnSaveY`='0.000000',`AH_SpawnSaveZ`='0.000000',`AH_SpawnSaveRot`='0.000000',`AH_TankVolumen`=0,`AH_Mats`=0,`AH_Neon`=0,`AH_NeonType`=0,`AH_Drugs`=0,`AH_StandTime`=0,`AH_Meter`=0 WHERE `sqlid`=1 AND `carkey`=0) - Successfully executed.
[20:44:41] >> mysql_query( Connection handle: 1 )
[20:44:41] CMySQLHandler::Query(UPDATE `cars` SET `ingarage`=0,`AH_Typ`=-1,`AH_X`='0.000000',`AH_Y`='0.000000',`AH_Z`='0.000000',`AH_Rot`='0.000000',`AH_Status`=0,`AH_Lock`=0,`AH_Paintjob`=-1,`AH_Farbe1`=-1,`AH_Farbe2`=-1,`AH_mod1`=-1,`AH_mod2`=-1,`AH_mod3`=-1,`AH_mod4`=-1,`AH_mod5`=-1,`AH_mod6`=-1,`AH_mod7`=-1,`AH_mod8`=-1,`AH_mod9`=-1,`AH_mod10`=-1,`AH_mod11`=-1,`AH_mod12`=-1,`AH_mod13`=-1,`AH_mod14`=-1,`AH_mod15`=-1,`AH_mod16`=-1,`AH_mod17`=-1,`AH_SpawnSaveX`=0.000000,`AH_SpawnSaveY`='0.000000',`AH_SpawnSaveZ`='0.000000',`AH_SpawnSaveRot`='0.000000',`AH_TankVolumen`=0,`AH_Mats`=0,`AH_Neon`=0,`AH_NeonType`=0,`AH_Drugs`=0,`AH_StandTime`=0,`AH_Meter`=0 WHERE `sqlid`=1 AND `carkey`=1) - Successfully executed.
[20:44:41] >> mysql_query( Connection handle: 1 )
[20:44:41] CMySQLHandler::Query(UPDATE `cars` SET `ingarage`=0,`AH_Typ`=-1,`AH_X`='0.000000',`AH_Y`='0.000000',`AH_Z`='0.000000',`AH_Rot`='0.000000',`AH_Status`=0,`AH_Lock`=0,`AH_Paintjob`=-1,`AH_Farbe1`=-1,`AH_Farbe2`=-1,`AH_mod1`=-1,`AH_mod2`=-1,`AH_mod3`=-1,`AH_mod4`=-1,`AH_mod5`=-1,`AH_mod6`=-1,`AH_mod7`=-1,`AH_mod8`=-1,`AH_mod9`=-1,`AH_mod10`=-1,`AH_mod11`=-1,`AH_mod12`=-1,`AH_mod13`=-1,`AH_mod14`=-1,`AH_mod15`=-1,`AH_mod16`=-1,`AH_mod17`=-1,`AH_SpawnSaveX`=0.000000,`AH_SpawnSaveY`='0.000000',`AH_SpawnSaveZ`='0.000000',`AH_SpawnSaveRot`='0.000000',`AH_TankVolumen`=0,`AH_Mats`=0,`AH_Neon`=0,`AH_NeonType`=0,`AH_Drugs`=0,`AH_StandTime`=0,`AH_Meter`=0 WHERE `sqlid`=1 AND `carkey`=2) - Successfully executed. -
Mensch....
Den Log vom Laden des Fahrzeugs. Siehst du on deinem PlayerCarConnect irgendwo ein UPDATE?
Poste bitte den richtigen Log. -
Nein beim neu Login wird nix geloggt.
-
-
Schreibe es mal so, und wenn es nichts lädt, poste was im Log steht:
Spoiler anzeigen public PlayerCarConnect(playerid)
{
printf("PlayerCarConnect: %d", playerid);
if(IsPlayerNPC(playerid))
{
return 1;
}
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
printf("name: %s", playername);
for(new h = 0; h < MaxVeh[playerid]; h++)
{
new data[100],TextString[256];
format(TextString, sizeof(TextString), "SELECT * FROM `cars` WHERE `sqlid`=%i AND `carkey`=%d", PlayerInfo[playerid][pSQLID], h);
printf("Textstring: %s", TextString);
self_mysql_query(TextString);
mysql_store_result(MySQLConnection);
printf("rows: %d", mysql_num_rows(MySQLConnection));
if(mysql_num_rows(MySQLConnection) != 0)
{
mysql_fetch_row_format(TextString);
self_mysql_get_field("id", data); Carlist[playerid][h][cid] = strval( data );
self_mysql_get_field("sqlid", data); Carlist[playerid][h][sqlid] = strval( data );
self_mysql_get_field("ingarage", data); Carlist[playerid][h][ingarage] = strval( data );
self_mysql_get_field("AH_Typ", data); Carlist[playerid][h][Typ] = strval( data );
self_mysql_get_field("AH_X", data); Carlist[playerid][h][pos_x] = floatstr( data );
self_mysql_get_field("AH_Y", data); Carlist[playerid][h][pos_y] = floatstr( data );
self_mysql_get_field("AH_Z", data); Carlist[playerid][h][pos_z] = floatstr( data );
self_mysql_get_field("AH_Rot", data); Carlist[playerid][h][z_angle] = floatstr( data );
self_mysql_get_field("AH_Status", data); Carlist[playerid][h][Status] = strval( data );
self_mysql_get_field("AH_Lock", data); Carlist[playerid][h][Lock] = strval( data );
self_mysql_get_field("AH_Paintjob", data); Carlist[playerid][h][Paintjob] = strval( data );
self_mysql_get_field("AH_Farbe1", data); Carlist[playerid][h][Farbe1] = strval( data );
self_mysql_get_field("AH_Farbe2", data); Carlist[playerid][h][Farbe2] = strval( data );
self_mysql_get_field("AH_mod1", data); Carlist[playerid][h][mod1] = strval( data );
self_mysql_get_field("AH_mod2", data); Carlist[playerid][h][mod2] = strval( data );
self_mysql_get_field("AH_mod3", data); Carlist[playerid][h][mod3] = strval( data );
self_mysql_get_field("AH_mod4", data); Carlist[playerid][h][mod4] = strval( data );
self_mysql_get_field("AH_mod5", data); Carlist[playerid][h][mod5] = strval( data );
self_mysql_get_field("AH_mod6", data); Carlist[playerid][h][mod6] = strval( data );
self_mysql_get_field("AH_mod7", data); Carlist[playerid][h][mod7] = strval( data );
self_mysql_get_field("AH_mod8", data); Carlist[playerid][h][mod8] = strval( data );
self_mysql_get_field("AH_mod9", data); Carlist[playerid][h][mod9] = strval( data );
self_mysql_get_field("AH_mod10", data); Carlist[playerid][h][mod10] = strval( data );
self_mysql_get_field("AH_mod11", data); Carlist[playerid][h][mod11] = strval( data );
self_mysql_get_field("AH_mod12", data); Carlist[playerid][h][mod12] = strval( data );
self_mysql_get_field("AH_mod13", data); Carlist[playerid][h][mod13] = strval( data );
self_mysql_get_field("AH_mod14", data); Carlist[playerid][h][mod14] = strval( data );
self_mysql_get_field("AH_mod15", data); Carlist[playerid][h][mod15] = strval( data );
self_mysql_get_field("AH_mod16", data); Carlist[playerid][h][mod16] = strval( data );
self_mysql_get_field("AH_mod17", data); Carlist[playerid][h][mod17] = strval( data );
self_mysql_get_field("AH_SpawnSaveX", data); Carlist[playerid][h][SpawnSaveX] = floatstr( data );
self_mysql_get_field("AH_SpawnSaveY", data); Carlist[playerid][h][SpawnSaveY] = floatstr( data );
self_mysql_get_field("AH_SpawnSaveZ", data); Carlist[playerid][h][SpawnSaveZ] = floatstr( data );
self_mysql_get_field("AH_SpawnSaveRot", data); Carlist[playerid][h][SpawnSaveRot] = floatstr( data );
self_mysql_get_field("AH_TankVolumen", data); Carlist[playerid][h][TankVolumen] = strval( data );
self_mysql_get_field("AH_Mats", data); Carlist[playerid][h][cMats] = strval(data);
self_mysql_get_field("AH_Neon", data); Carlist[playerid][h][Neon] = strval(data);
self_mysql_get_field("AH_NeonType", data); Carlist[playerid][h][NeonType] = strval(data);
self_mysql_get_field("AH_Drugs", data); Carlist[playerid][h][cDrugs] = strval(data);
self_mysql_get_field("AH_StandTime", data); Carlist[playerid][h][StandTime] = strval(data);
self_mysql_get_field("AH_Meter", data); Kilometer[Carlist[playerid][h][h]] = strval(data);
Carlist[playerid][h][Carid] = CreateTunedCar(playerid, h);
/*if(Carlist[playerid][h][Typ] != -1 && Carlist[playerid][h][Status] == 0)
{
printf("Fahrzeugspeicherung: Beginning Spawn.");
printf("Fahrzeugspeicherung: End Spawn.");
}*/
printf("(%d,%d,%i,%i,%f,%f,%f,%f,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%f,%f,%f,%f,%i,%i,%i,%i,%i,%i,%f)",
PlayerInfo[playerid][pSQLID],h,Carlist[playerid][h][ingarage],Carlist[playerid][h][Typ],Carlist[playerid][h][pos_x],Carlist[playerid][h][pos_y],Carlist[playerid][h][pos_z],
Carlist[playerid][h][z_angle],Carlist[playerid][h][Status],Carlist[playerid][h][Lock],Carlist[playerid][h][Paintjob],
Carlist[playerid][h][Farbe1],Carlist[playerid][h][Farbe2],Carlist[playerid][h][mod1],Carlist[playerid][h][mod2],
Carlist[playerid][h][mod3],Carlist[playerid][h][mod4],Carlist[playerid][h][mod5],Carlist[playerid][h][mod6],
Carlist[playerid][h][mod7],Carlist[playerid][h][mod8],Carlist[playerid][h][mod9],Carlist[playerid][h][mod10],
Carlist[playerid][h][mod11],Carlist[playerid][h][mod12],Carlist[playerid][h][mod13],Carlist[playerid][h][mod14],
Carlist[playerid][h][mod15],Carlist[playerid][h][mod16],Carlist[playerid][h][mod17],
Carlist[playerid][h][SpawnSaveX],Carlist[playerid][h][SpawnSaveY],Carlist[playerid][h][SpawnSaveZ],
Carlist[playerid][h][SpawnSaveRot],Carlist[playerid][h][TankVolumen],Carlist[playerid][h][cMats],
Carlist[playerid][h][Neon],Carlist[playerid][h][NeonType],Carlist[playerid][h][cDrugs],Carlist[playerid][h][StandTime],
Kilometer[Carlist[playerid][h][CarID]]);
}
}
printf("Ende");
return 1;
}
-
Danke es funktioniert aber warum wird das Textdraw beim login jetzt gezeigt?
-
Was meinst du? In dem Code ist kein Textdraw.
-
Seit der Code drin ist kommt ständig das Tacho und ein AMX bachtrace
[22:26:02] [debug] Run time error 4: "Array index out of bounds"
[22:26:02] [debug] Accessing element at index 65535 past array upper bound 199
[22:26:02] [debug] AMX backtrace:
[22:26:02] [debug] #0 0001a68c in public OnPlayerTakeDamage (1, 65535, 1105183830, 54, 3) from irp(3).amx -
Naja, wie gesagt, an der Änderung die ich gemacht habe kann es nicht liegen.
Poste dann mal dein OnPlayerTakeDamage, das mit dem Tacho schauen wir uns danach an. -
Public:
ublic OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
new string[126];
if(HitSound[issuerid] == 1)
{
PlayerPlaySound(issuerid,17802,0.0,0.0,0.0);
}
format(string, sizeof(string), "%f", amount);
new sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, giveplayer, sizeof(giveplayer)); //Er Verliert HP
GetPlayerName(issuerid, sendername, sizeof(sendername)); // Er hat Geschossen
if(NoDmTimer[playerid] > 0){
new PunishTime, PunsihRestTime;
if(IsAHitman(issuerid) && GoChase[issuerid] == playerid){
PunishTime = 60;
}
else{
PunishTime = 15;
}
PunsihRestTime = PunishTime-NoDmTimer[playerid];
if(PunsihRestTime > 0){
format(string, sizeof(string), "Der NO-DM schutz deines Opfers beginnt in %d Sekunden", PunsihRestTime);
SendClientMessage(issuerid,COLOR_GRAD2, string);
}
else
{
format(string, sizeof(string), "%s hat auf dich in einer NO-DM Zone geschossen !", sendername);
SendClientMessage(playerid,COLOR_GRAD2, string);
}
}
if(SpawnKillAktiv[playerid] == 1 && weaponid != 54 && weaponid != 51){
SendClientMessage(issuerid,COLOR_YELLOW, "[Anti Spawnkill] Unter lass das Dm auf Usern mit Spawnkill schutz !");
format(string, sizeof(string), "[Anti Spawnkill] %s hat dich Angeschossen.", sendername);
SendClientMessage(playerid,COLOR_YELLOW, string);
}
if(SpawnKillAktiv[issuerid] == 1){SpawnSkillSchutz(issuerid);}
if(weaponid == 23 && TazerCan[issuerid] == 1)
{
if(PlayerInfo[issuerid][pMember] == 7 && OnDuty[issuerid] == 1 || PlayerInfo[playerid][pAdmin] >= 3 || PlayerInfo[issuerid][pMember] == 14 && OnDuty[issuerid] == 1 || PlayerInfo[issuerid][pMember] == 16 && OnDuty[issuerid] == 1 || PlayerInfo[issuerid][pMember] == 13 && OnDuty[issuerid] == 1)
{
if(IsPlayerInAnyVehicle(issuerid))
{
return 1;
}
new suspect = playerid;
if(IsPlayerConnected(suspect))
{
if(PlayerCuffed[suspect] > 0)
{
SendClientMessage(issuerid, COLOR_ERRORTEXT, " Spieler ist schon getazert!");
return 1;
}
if(IsPlayerInAnyVehicle(suspect))
{
SendClientMessage(issuerid, COLOR_ERRORTEXT, " Ziel ist in einem Auto, es muss zuerst aussteigen!");
return 1;
}
GivePlayerWeapons(issuerid, PlayerInfo[issuerid][pGun2], PlayerInfo[issuerid][pAmmo2]);
TazerCan[issuerid] = 0;
format(string, sizeof(string), "* Du wurdest von %s elektrisiesrt für 30 sekunden.", sendername);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Du elektrisierst %s für 30 sekunden.", giveplayer);
SendClientMessage(issuerid, COLOR_LIGHTBLUE, string);
if(Maske[suspect] == 1)
{
format(string, sizeof(string), "* %s schießt mit dem Tazer auf einen Unbekannten, und elektrisiert ihn.", sendername);
ProxDetector(60.0, issuerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
format(string, sizeof(string), "* %s schießt mit dem Tazer auf %s, und elektrisiert ihn.", sendername ,giveplayer);
ProxDetector(60.0, issuerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
GameTextForPlayer(suspect, "~r~Tazed", 5000, 3);
ApplyAnimation(suspect, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); // Dieing of Crack
PlayerCuffed[suspect] = 1;
PlayerCuffedTime[suspect] = 30;
}
}
}
return 1;
} -
Schreibe es so, dann sollte die Meldung weg sein:
Spoiler anzeigen public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID)
{
new string[126];
if(HitSound[issuerid] == 1)
{
PlayerPlaySound(issuerid,17802,0.0,0.0,0.0);
}
format(string, sizeof(string), "%f", amount);
new sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, giveplayer, sizeof(giveplayer)); //Er Verliert HP
GetPlayerName(issuerid, sendername, sizeof(sendername)); // Er hat Geschossen
if(NoDmTimer[playerid] > 0)
{
new PunishTime, PunsihRestTime;
if(IsAHitman(issuerid) && GoChase[issuerid] == playerid)
{
PunishTime = 60;
}
else
{
PunishTime = 15;
}
PunsihRestTime = PunishTime-NoDmTimer[playerid];
if(PunsihRestTime > 0)
{
format(string, sizeof(string), "Der NO-DM schutz deines Opfers beginnt in %d Sekunden", PunsihRestTime);
SendClientMessage(issuerid,COLOR_GRAD2, string);
}
else
{
format(string, sizeof(string), "%s hat auf dich in einer NO-DM Zone geschossen !", sendername);
SendClientMessage(playerid,COLOR_GRAD2, string);
}
}
if(SpawnKillAktiv[playerid] == 1 && weaponid != 54 && weaponid != 51)
{
SendClientMessage(issuerid,COLOR_YELLOW, "[Anti Spawnkill] Unter lass das Dm auf Usern mit Spawnkill schutz !");
format(string, sizeof(string), "[Anti Spawnkill] %s hat dich Angeschossen.", sendername);
SendClientMessage(playerid,COLOR_YELLOW, string);
}
if(SpawnKillAktiv[issuerid] == 1)
{
SpawnSkillSchutz(issuerid);
}
if(weaponid == 23 && TazerCan[issuerid] == 1)
{
if(PlayerInfo[issuerid][pMember] == 7 && OnDuty[issuerid] == 1 || PlayerInfo[playerid][pAdmin] >= 3 || PlayerInfo[issuerid][pMember] == 14 && OnDuty[issuerid] == 1 || PlayerInfo[issuerid][pMember] == 16 && OnDuty[issuerid] == 1 || PlayerInfo[issuerid][pMember] == 13 && OnDuty[issuerid] == 1)
{
if(IsPlayerInAnyVehicle(issuerid))
{
return 1;
}
new suspect = playerid;
if(IsPlayerConnected(suspect))
{
if(PlayerCuffed[suspect] > 0)
{
SendClientMessage(issuerid, COLOR_ERRORTEXT, " Spieler ist schon getazert!");
return 1;
}
if(IsPlayerInAnyVehicle(suspect))
{
SendClientMessage(issuerid, COLOR_ERRORTEXT, " Ziel ist in einem Auto, es muss zuerst aussteigen!");
return 1;
}
GivePlayerWeapons(issuerid, PlayerInfo[issuerid][pGun2], PlayerInfo[issuerid][pAmmo2]);
TazerCan[issuerid] = 0;
format(string, sizeof(string), "* Du wurdest von %s elektrisiesrt für 30 sekunden.", sendername);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Du elektrisierst %s für 30 sekunden.", giveplayer);
SendClientMessage(issuerid, COLOR_LIGHTBLUE, string);
if(Maske[suspect] == 1)
{
format(string, sizeof(string), "* %s schießt mit dem Tazer auf einen Unbekannten, und elektrisiert ihn.", sendername);
ProxDetector(60.0, issuerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
format(string, sizeof(string), "* %s schießt mit dem Tazer auf %s, und elektrisiert ihn.", sendername ,giveplayer);
ProxDetector(60.0, issuerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
GameTextForPlayer(suspect, "~r~Tazed", 5000, 3);
ApplyAnimation(suspect, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); // Dieing of Crack
PlayerCuffed[suspect] = 1;
PlayerCuffedTime[suspect] = 30;
}
}
}
}
return 1;
}
-
Geht jetzt bleibt nur noch das mit dem Textdraw
-
Wir kommen voran.
Poste da bitte den Code und erkläre was das Problem ist. -
Dieser Textdraw wird seitdem OnPlayerCarConnect Fix gezeit auch wenn man nicht im Car sitzt:
Tacho9[i] = TextDrawCreate(287.600128, 319.579925, "usebox");
TextDrawLetterSize(Tacho9[i], 0.000000, 7.947039);
TextDrawTextSize(Tacho9[i], 177.199905, 0.000000);
TextDrawAlignment(Tacho9[i], 1);
TextDrawColor(Tacho9[i], 0);
TextDrawUseBox(Tacho9[i], true);
TextDrawBoxColor(Tacho9[i], 102);
TextDrawSetShadow(Tacho9[i], 187);
TextDrawSetOutline(Tacho9[i], 0);
TextDrawFont(Tacho9[i], 0); -