Egal was auch immer ich jetzt gemacht habe aber es hat dadurch geklappt
Beiträge von Blackshadowscript
-
-
Server.log:
----------
Loaded log file: "server_log.txt".
----------SA-MP Dedicated Server
----------------------
v0.3.7, (C)2005-2015 SA-MP Team[20:49:01] filterscripts = "" (string)
[20:49:01]
[20:49:01] Server Plugins
[20:49:01] --------------
[20:49:01] Loading plugin: mysql
[20:49:01] >> plugin.mysql: R39 successfully loaded.
[20:49:01] Loaded.
[20:49:01] Loading plugin: sscanf
[20:49:01][20:49:01] ===============================
[20:49:01] sscanf plugin loaded.
[20:49:01] (c) 2009 Alex "Y_Less" Cole
[20:49:01] 0.3d-R2 500 Players "dnee"
[20:49:01] ===============================
[20:49:01] Loaded.
[20:49:01] Loaded 2 plugins.[20:49:01]
[20:49:01] Ban list
[20:49:01] --------
[20:49:01] Loaded: samp.ban
[20:49:01]
[20:49:01]
[20:49:01] Filterscripts
[20:49:01] ---------------
[20:49:01] Loaded 0 filterscripts.[20:49:01] Mysql wurde verbunden!
[20:49:01]
----------------------------------
[20:49:01] Exilium Reallife Version 1.0
[20:49:01] ----------------------------------[20:49:01] Number of vehicle models: 6
[20:49:33] [connection] 127.0.0.1:59366 requests connection cookie.
[20:49:34] Incoming connection: 127.0.0.1:59366 id: 0
[20:49:34] [join] Blackshadowscript has joined the server (0:127.0.0.1)
[20:50:14] i: 0 | vID: 7 | idx: 7
[20:50:14] besitzer: ÿlackshadowscript | SpielerName: -
mysql.log:
SQL[20:46:01] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0' WHERE id='2000'' at line 1
server.log:
Code
Alles anzeigen---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3.7, (C)2005-2015 SA-MP Team [20:44:42] filterscripts = "" (string) [20:44:42] [20:44:42] Server Plugins [20:44:42] -------------- [20:44:42] Loading plugin: mysql [20:44:42] >> plugin.mysql: R39 successfully loaded. [20:44:42] Loaded. [20:44:42] Loading plugin: sscanf [20:44:42] [20:44:42] =============================== [20:44:42] sscanf plugin loaded. [20:44:42] (c) 2009 Alex "Y_Less" Cole [20:44:42] 0.3d-R2 500 Players "dnee" [20:44:42] =============================== [20:44:42] Loaded. [20:44:42] Loaded 2 plugins. [20:44:42] [20:44:42] Ban list [20:44:42] -------- [20:44:42] Loaded: samp.ban [20:44:42] [20:44:42] [20:44:42] Filterscripts [20:44:42] --------------- [20:44:42] Loaded 0 filterscripts. [20:44:42] Mysql wurde verbunden! [20:44:42] ---------------------------------- [20:44:42] Exilium Reallife Version 1.0 [20:44:42] ---------------------------------- [20:44:42] Number of vehicle models: 6 [20:45:04] [connection] 127.0.0.1:61963 requests connection cookie. [20:45:05] Incoming connection: 127.0.0.1:61963 id: 0 [20:45:05] [join] Blackshadowscript has joined the server (0:127.0.0.1) [font='Arial, Helvetica, sans-serif'][color=#ff0000][size=14][20:46:01] Query: UPDATE user SET level='66', money='1080', alevel='7', fraktion='0', rang='0' WHERE id='1'[/size][/color][/font] [20:46:01] [part] Blackshadowscript has left the server (0:1) [20:46:40] --- Server Shutting Down. [20:46:41] plugin.mysql: Unloading plugin... [20:46:41] plugin.mysql: Plugin unloaded. [20:46:41] [20:46:41] =============================== [20:46:41] sscanf plugin unloaded. [20:46:41] ===============================
-
ja sry jeffry meinte SendClientMessage(playerid, hellgrün, "Du sitzt nicht in deinem Auto!"); im befehl
-
der macht es immer noch nicht
Mysql.log:
SQL[20:33:00] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0' WHERE id='2000'' at line 1 [20:33:00] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0'' at line 1
-
Denn Beitrag bitte nicht mehr beachten. Neuer Beitrag wurde gemacht der bisschen ausführlicher geschrieben ist
-
Autoparken:
ocmd:autoparken(playerid, params[])
{
new vID = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid, hellgrün, "Du bist in kein Auto!");
for (new i = 0; i < sizeof(aInfo); i++)
{
if(vID == aInfo[i] [id_x])
{
if(!strcmp(aInfo[i][besitzer], SpielerName(playerid)))
{
new query[128];
GetVehiclePos(vID, aInfo[i][c_x],aInfo[i][c_y],aInfo[i][c_z]);
GetVehicleZAngle(vID,aInfo[i][c_r]);
format(query, sizeof(query), "UPDATE Autos SET c_x='%f',c_y='%f',c_z='%f',c_r='%f' WHERE id='%i' ",aInfo[i] [c_x],aInfo[i] [c_y],aInfo[i] [c_z],aInfo[i] [c_r],aInfo[i] [db_id]);
mysql_function_query(dbhandle,query,false," "," ");
SendClientMessage(playerid, hellgrün, "Du hast dein Auto geparkt.");
return 1;
}
break;
}
}
return SendClientMessage(playerid, hellgrün, "Du sitzt nicht in deinem Auto!");
}ich glaube du meinst das hier:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
} -
Das steht in der Server.log:
Code
Alles anzeigenSA-MP Dedicated Server ---------------------- v0.3.7, (C)2005-2015 SA-MP Team [20:23:25] filterscripts = "" (string) [20:23:25] [20:23:25] Server Plugins [20:23:25] -------------- [20:23:25] Loading plugin: mysql [20:23:25] >> plugin.mysql: R39 successfully loaded. [20:23:25] Loaded. [20:23:25] Loading plugin: sscanf [20:23:25] [20:23:25] =============================== [20:23:25] sscanf plugin loaded. [20:23:25] (c) 2009 Alex "Y_Less" Cole [20:23:25] 0.3d-R2 500 Players "dnee" [20:23:25] =============================== [20:23:25] Loaded. [20:23:25] Loaded 2 plugins. [20:23:25] [20:23:25] Ban list [20:23:25] -------- [20:23:25] Loaded: samp.ban [20:23:25] [20:23:25] [20:23:25] Filterscripts [20:23:25] --------------- [20:23:25] Loaded 0 filterscripts. [20:23:25] Mysql wurde verbunden! [20:23:25] ---------------------------------- [20:23:25] Exilium Reallife Version 1.0 [20:23:25] ---------------------------------- [20:23:25] Number of vehicle models: 6 [20:23:51] [connection] 127.0.0.1:58331 requests connection cookie. [20:23:52] Incoming connection: 127.0.0.1:58331 id: 0 [20:23:52] [join] Blackshadowscript has joined the server (0:127.0.0.1) [20:24:37] [part] Blackshadowscript has left the server (0:1)
Das steht in der mysql.log:
SQL[20:14:22] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0'' at line 1 [20:19:32] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0' WHERE id='2000'' at line 1 [20:19:32] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0'' at line 1 [20:24:37] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0' WHERE id='2000'' at line 1 [20:24:37] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0'' at line 1
-
ich habe es jetzt so gemacht aber es geht immer noch nicht
-
Dann frage ich mich wieso es bei:
Funktioniert und habe es genau so gemacht wie er es gemacht hat und da geht es komischerweise.
-
Ich habe folgendes Problem das wenn ich mir was ingame Kaufe wird der geld wert von 1500$ zwar abgezogen dann aber nicht gespeichert und somit wieder auf 1500$ gesetzt.
So sieht es aus:
savePlayer(playerid)
{
if(sInfo[playerid][eingeloggt]==0)return 1;
//speichern level,money
new query[128];
format(query,sizeof(query),"UPDATE user SET level= '%i', money= '%i', alevel= '%i', fraktion= '%i', rang= '%i' WHERE `id` ='%i'",sInfo[playerid][level],GetPlayerMoney(playerid),sInfo[playerid][alevel],sInfo[playerid][fraktion],sInfo[playerid][rang],sInfo[playerid][db_id]);
mysql_function_query(dbhandle,query,false,"","");
return 1;
}resetPlayer(playerid)
{
for(new i=0; i<sizeof(sInfo[]); i++)
{
sInfo[playerid][playerInfo:i]=0;
loadPlayerCars(playerid);
}
return 1;
}public OnPlayerDisconnect(playerid, reason)
{
for(new i=0; i<sizeof(aInfo); i++)
{
if(aInfo[i][id_x]==0)continue;
if(aInfo[i][besitzer]!=sInfo[playerid][db_id])continue;
GetVehiclePos(aInfo[i][id_x],aInfo[i][c_x],aInfo[i][c_y],aInfo[i][c_z]);
GetVehicleZAngle(aInfo[i][id_x],aInfo[i][c_r]);
new query[128];
format(query,sizeof(query),"UPDATE autos SET x='%f', y='%f', z='%f', r='%f' WHERE id='%i' ",aInfo[i][c_x],aInfo[i][c_y],aInfo[i][c_z],aInfo[i][c_r],aInfo[i][db_id]);
mysql_function_query(dbhandle,query,false,"","");
DestroyVehicle(aInfo[i][id_x]);
aInfo[i][id_x]=0;
break;
}
resetPlayer(playerid);
savePlayer(playerid);
loadPlayerCars(playerid);
return 1;
}Das hier gehört auch noch dazu:
SetPlayerMoney(playerid,money)
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid,money);
return 1;
}
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);//autosladen:
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;
} -
also ansich geht der befehel nur das prob ist halt wenn ich einsteige sagt er mir fahrzeug gehört nicht ihnen
-
Es geht immer noch nicht. Selbst wenn ich es printe und einlogge wird nichts in den loggs rein geschriben
-
MYSQL.Log:
SQL
Alles anzeigen[15:40:28] [ERROR] CMySQLHandle::Connect - (error #2003) Can't connect to MySQL server on '5.39.74.166' (111) [15:40:52] [ERROR] CMySQLQuery::Execute[OnUserCheck(i)] - (error #2006) MySQL server has gone away [15:40:52] [WARNING] CMySQLQuery::Execute[OnUserCheck(i)] - lost connection, reconnecting.. [15:40:52] [ERROR] CMySQLHandle::Connect - (error #2003) Can't connect to MySQL server on '5.39.74.166' (111) [15:48:58] [ERROR] CMySQLQuery::Execute[()] - (error #1062) Duplicate entry '0' for key 'PRIMARY' [16:00:54] [ERROR] CMySQLQuery::Execute[()] - (error #1062) Duplicate entry '0' for key 'PRIMARY' [16:06:02] [ERROR] CMySQLQuery::Execute[()] - (error #1062) Duplicate entry '0' for key 'PRIMARY' [16:06:22] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='1',,rang='0' WHERE id='0'' at line 1 [16:07:21] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='1',,rang='0' WHERE id='0'' at line 1 [16:08:08] [ERROR] CMySQLQuery::Execute[()] - (error #1062) Duplicate entry '0' for key 'PRIMARY' [16:16:01] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='1',,rang='0' WHERE id='0'' at line 1 [16:17:45] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='1',,rang='0' WHERE id='1'' at line 1 [16:17:45] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='2',,rang='0' WHERE id='2'' at line 1 [16:21:18] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='2',,rang='0' WHERE id='2'' at line 1 [16:58:58] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='1',,rang='0' WHERE id='1'' at line 1 [17:03:51] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='2',,rang='0' WHERE id='2'' at line 1 [18:02:27] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='5',,rang='5' WHERE id='2'' at line 1 [18:05:51] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='2',,rang='0' WHERE id='2'' at line 1 [18:16:29] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='0',,rang='5' WHERE id='1'' at line 1 [18:17:55] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='2',,rang='0' WHERE id='2'' at line 1 [18:28:59] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='4',,rang='5' WHERE id='1'' at line 1 [18:35:44] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='0',,rang='5' WHERE id='1'' at line 1 [18:41:35] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='4',,rang='5' WHERE id='1'' at line 1 [18:57:58] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='1',,rang='0' WHERE id='1'' at line 1 [19:40:43] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='10',,rang='5' WHERE id='1'' at line 1 [20:21:34] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='1',,rang='0' WHERE id='1'' at line 1 [23:29:27] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='0',,rang='0' WHERE id='7'' at line 1 [23:31:48] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='1',,rang='0' WHERE id='1'' at line 1 [23:31:55] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='0',,rang='0' WHERE id='7'' at line 1 [23:35:30] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='0',,rang='0' WHERE id='5'' at line 1 [23:41:43] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='0',,rang='0' WHERE id='5'' at line 1 [23:47:27] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='1',,rang='0' WHERE id='1'' at line 1 [13:16:41] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='2',,rang='0' WHERE id='2'' at line 1 [13:16:59] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='1',,rang='0' WHERE id='1'' at line 1 [13:28:11] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='1',,rang='99999999' WHERE id='7'' at line 1 [13:28:11] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='5',,rang='999965' WHERE id='7'' at line 1 [13:33:05] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='1',,rang='99999999' WHERE id='7'' at line 1 [13:57:13] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='5',,rang='966275' WHERE id='7'' at line 1 [13:58:15] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='1',,rang='992281' WHERE id='7'' at line 1 [14:06:03] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='0',,rang='999541' WHERE id='7'' at line 1 [14:09:27] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='0',,rang='999965' WHERE id='7'' at line 1 [14:13:01] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='0',,rang='968461' WHERE id='7'' at line 1 [14:34:12] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fraktion='0',,rang='0' WHERE id='0'' at line 1
Server.log:
----------
Loaded log file: "server_log.txt".
----------SA-MP Dedicated Server
----------------------
v0.3.7, (C)2005-2015 SA-MP Team[05/06/2015 16:38:59]
[05/06/2015 16:38:59] Server Plugins
[05/06/2015 16:38:59] --------------
[05/06/2015 16:38:59] Loading plugin: streamer.so
[05/06/2015 16:38:59]*** Streamer Plugin v2.6.1 by Incognito loaded ***
[05/06/2015 16:38:59] Loaded.
[05/06/2015 16:38:59] Loading plugin: sscanf.so
[05/06/2015 16:38:59][05/06/2015 16:38:59] ===============================
[05/06/2015 16:38:59] sscanf plugin loaded.
[05/06/2015 16:38:59] Version: 2.8.1
[05/06/2015 16:38:59] (c) 2012 Alex "Y_Less" Cole
[05/06/2015 16:38:59] ===============================
[05/06/2015 16:38:59] Loaded.
[05/06/2015 16:38:59] Loading plugin: mysql.so
[05/06/2015 16:38:59] >> plugin.mysql: running on 4 threads.
[05/06/2015 16:38:59] >> plugin.mysql: R31 successfully loaded.
[05/06/2015 16:38:59] Loaded.
[05/06/2015 16:38:59] Loaded 3 plugins.[05/06/2015 16:38:59]
[05/06/2015 16:38:59] Ban list
[05/06/2015 16:38:59] --------
[05/06/2015 16:38:59] Loaded: samp.ban
[05/06/2015 16:38:59]
[05/06/2015 16:38:59]
[05/06/2015 16:38:59] Filterscripts
[05/06/2015 16:38:59] ---------------
[05/06/2015 16:38:59] Loaded 0 filterscripts.[05/06/2015 16:38:59] Mysql wurde verbunden!
[05/06/2015 16:38:59]
----------------------------------
[05/06/2015 16:38:59] Exilium Reallife Version 1.0
[05/06/2015 16:38:59] ----------------------------------[05/06/2015 16:38:59] Number of vehicle models: 6
-
Es geht leider immer noch nicht Jeffry bekomme immer wieder 999541$ beim einloggen obwohl ich mir eigentlich ein Auto gekauft habe
-
jetzt taucht bei:
ocmd:autoentfernen(playerid, params[])
{
new vID = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid, hellgrün, "Du bist in kein Auto!");
for (new i = 0; i < sizeof(aInfo); i++)
{
if(vID == aInfo[i] [id_x])
{
if(!strcmp(aInfo[i][besitzer], SpielerName(playerid)))
{
new query[128];
format(query, sizeof(query), "DELETE FROM autos WHERE id='%i'",aInfo[i][db_id]);
mysql_function_query(dbhandle,query,false," "," ");
DestroyVehicle(aInfo[i][besitzer]);
aInfo[i][autoEnum] = 0;
SendClientMessage(playerid, hellgrün, "Du hast dein Auto entfernt.");
return 1;
}
break;
}
}
return SendClientMessage(playerid, hellgrün, "Du sitzt nicht in deinem Auto!");
}Fehler:
samplernen.p(992) : error 032: array index out of bounds (variable "aInfo")
auf -
Also mein Startwert is 999541$ wenn ich mein autorepariere beim Pay´N Spray was mich ja 100$ kostet sollte ich normal bei 999441$ sein aber bekomme immer wieder 999541$ und habe echt kein plan woran das jetzt liegt
-
Guten Tag.
Mir ist jetzt mein Befehl um Fahrzeuge zu parken
Enum:
enum autoEnum{
id_x,
model,
besitzer[MAX_PLAYER_NAME],
Float:c_x,
Float:c_y,
Float:c_z,
Float:c_r,
db_id
}new aInfo[50][autoEnum];
Befehl um die Fahrzeuge zu parken:
ocmd:autoparken(playerid, params[])
{
new vID = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid, hellgrün, "Du bist in kein Auto!");
for (new i = 0; i < sizeof(aInfo); i++)
{
if(vID == aInfo[i] [autoEnum])
{
if(!strcmp(aInfo[i][besitzer], SpielerName(playerid)))
{
new query[128];
GetVehiclePos(vID, aInfo[i][c_x],aInfo[i][c_y],aInfo[i][c_z]);
GetVehicleZAngle(vID,aInfo[i][c_r]);
format(query, sizeof(query), "UPDATE Autos SET c_x='%f',c_y='%f',c_z='%f',c_r='%f' WHERE id='%i' ",aInfo[i] [c_x],aInfo[i] [c_y],aInfo[i] [c_z],aInfo[i] [c_r],aInfo[i] [db_id]);
mysql_function_query(dbhandle,query,false," "," ");
SendClientMessage(playerid, hellgrün, "Du hast dein Auto geparkt.");
return 1;
}
break;
}
}
return SendClientMessage(playerid, hellgrün, "Du sitzt nicht in deinem Auto!");
}Fehler:
samplernen.p(895) : error 032: array index out of bounds (variable "aInfo")
samplernen.p(943) : error 032: array index out of bounds (variable "aInfo")
samplernen.p(951) : error 032: array index out of bounds (variable "aInfo")Es hängt aber auch noch mit:
createPlayerCar(playerid,modelid,Float:x,Float:y,Float:z,Float:r)
{
for(new i=0; i<sizeof(aInfo); i++)
{
if(aInfo[i][id_x]!=0)continue;
aInfo[i][besitzer]=sInfo[playerid][db_id];
aInfo[i][c_x] =x;
aInfo[i][c_y] =y;
aInfo[i][c_z] =z;
aInfo[i][c_r] =r;
aInfo[i][model] =modelid;
aInfo[i][id_x] = CreateVehicle(modelid,x,y,z,r,-1,-1,-1);
new string[128];
format(string,sizeof(string),"Das Auto aInfo[%i]wurde erstellt",i);
SendClientMessageToAll(duneklhelblau,string);
saveCarToDB(playerid,i);
return 1;
}
return 1;
}in verbindung also wird es glaub ich schwer die sache zu beheben
public carSavedToDB(carid)
{
aInfo[carid][db_id]=cache_insert_id(dbhandle);
return 1;
}saveCarToDB(playerid,carid)
{
new query[128];
format(query,sizeof(query),"INSERT INTO autos(besitzer,model,x,y,z,r) VALUES('%i','%i','%f','%f','%f','%f')",sInfo[playerid][db_id],aInfo[carid][model],aInfo[carid][c_x],aInfo[carid][c_y],aInfo[carid][c_z],aInfo[carid][c_r]);
mysql_function_query(dbhandle,query,true,"carSavedToDB","i",carid);
return 1;
} -
ocmd:abschliessen(playerid,params[])
{
new Float:x,Float:y,Float:z;
if(!IsPlayerInRangeOfPoint(playerid,3,x,y,z)
new vID=GetPlayerVehicleID(playerid),
motor,
licht,
alarm,
tueren,
bonnet,
boot,
objective;
//abschliessen:
GetVehicleParamsEx(vID,motor,licht,alarm,tueren,bonnet,boot,objective);
if(tueren==1){
tueren = 0;
}
else
{
tueren = 1;
}
SetVehicleParamsEx(vID,motor,licht,alarm,tueren,bonnet,boot,objective);
SendClientMessage(playerid,blau,"Du hast die Türen aufgeschlossen/abgeschlossen");
new vID = INVALID_VEHICLE_ID;
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
new Float:Pos[3];
for(new i=0;i<MAX_VEHICLES; i++)
{
GetVehiclePos(i, Pos[0], Pos[1], Pos[2]);
if(IsPlayerInRangeOfPoint(playerid, 5.0, Pos[0], Pos[1], Pos[2]))
{
vID = i;
break;
}
}
}
else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
vID = GetPlayerVehicleID(playerid);
}
if(vID == INVALID_VEHICLE_ID) return SendClientMessage(playerid, 0xFF0000FF, "Error: Nicht nahe oder in einem Fahrzeug.");return 1;
} -
Ich will es eigentlich so haben:
Spieler loggt sich ein geht arbeiten und hat z.B. 100$ auf der Hand. Spieler geht zum BSN und kauft sich für 12$ etwas zum Essen. Spieler hat nun 88$ auf der Hand.
Spieler loggt sich vom Server. Spieler wird gespeicher und alle werte werden auf null gesetzt.
Spieler geht wieder auf den Server und loggt sich mit sein Spielernamen und Passwort ein. Spieler bekommt die werte aus der Datenbank zurück und hat nun seine 88$ auf der hand.