Der Fehler ist immer noch ..
enum carInfo
{
frakid,
frakname[64],
carid,
Float:PosX,
Float:PosY,
Float:PosZ,
Float:PosA,
Farbe1,
Farbe2,
}
new AutoInfo[MAX_VEHICLES][carInfo];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
for (new i=0; i< MAX_VEHICLES; i++)
{
if(newstate==PLAYER_STATE_DRIVER)
{
if(!strcmp(AutoInfo[i][frakname],"lspd",true))
{
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
{
SendClientMessage(playerid,0xFF0000FF,"Du bist in der Fraktion");
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,0xFF0000FF,"Du bist nicht in der Fraktion");
}
}
if(!strcmp(AutoInfo[i][frakname],"lcn",true))
{
if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 5)
{
SendClientMessage(playerid,0xFF0000FF,"Du bist in der Fraktion");
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,0xFF0000FF,"Du bist nicht in der Fraktion");
}
}
if(!strcmp(AutoInfo[i][frakname],"oamt",true))
{
if(PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pMember] == 4)
{
SendClientMessage(playerid,0xFF0000FF,"Du bist in der Fraktion");
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,0xFF0000FF,"Du bist nicht in der Fraktion");
}
}
if(!strcmp(AutoInfo[i][frakname],"zivi",true))
{
if(PlayerInfo[playerid][pLeader] == 0 || PlayerInfo[playerid][pMember] == 0)
{
}
else
{
}
}
}
}
return 1;
}
stock LoadAutosData()
{
for(new i;i<MAX_VEHICLES;i++)
{
new query[128],data[128],bedienung[40], carname[64];
format(bedienung,sizeof(bedienung),"id='%i'",i);
format(query,sizeof(query),"SELECT * FROM cardata WHERE %s", bedienung);//Die query
mysql_query(query);
mysql_store_result();
if(mysql_num_rows())// Eine Abfrage zur Sicherheit
{
format(carname,sizeof(carname),"%s",AutoInfo[i][frakname]);
mysql_fetch_field("FrakName",carname);
AutoInfo[i][frakname]= carname;
mysql_fetch_field("fn",data);
AutoInfo[i][frakid]=strval(data);
strdel(data,0,100);
mysql_fetch_field("CarID",data);
AutoInfo[i][carid]=strval(data);
strdel(data,0,100);
mysql_fetch_field("X",data);
AutoInfo[i][PosX]=strval(data);
strdel(data,0,100);
mysql_fetch_field("Y",data);
AutoInfo[i][PosY]=strval(data);
strdel(data,0,100);
mysql_fetch_field("Z",data);
AutoInfo[i][PosZ]=strval(data);
strdel(data,0,100);
mysql_fetch_field("A",data);
AutoInfo[i][PosA]=strval(data);
strdel(data,0,100);
mysql_fetch_field("Farbe1",data);
AutoInfo[i][Farbe1]=strval(data);
strdel(data,0,100);
mysql_fetch_field("Farbe2",data);
AutoInfo[i][Farbe2]=strval(data);
strdel(data,0,100);
}
AutoInfo[i][frakname] = CreateVehicle(AutoInfo[i][carid],AutoInfo[i][PosX],AutoInfo[i][PosY],AutoInfo[i][PosZ],AutoInfo[i][PosA],AutoInfo[i][Farbe1],AutoInfo[i][Farbe2],-1);
mysql_free_result();
printf("%s",carname);
}
return printf("Autos wurden Geladen");
}
Server-Log:
Loaded log file: "server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3c R2, (C)2005-2011 SA-MP Team
[20:38:43]
[20:38:43] Server Plugins
[20:38:43] --------------
[20:38:43] Loading plugin: mysql.so
[20:38:43] SA:MP MySQL Plugin v2.1.1 Loaded.
[20:38:43] [MySQL] Thread running. Threadsafe: Yes.
[20:38:43] Loaded.
[20:38:43] Loading plugin: sscanf.so
[20:38:43]
[20:38:43] ===============================
[20:38:43] sscanf plugin loaded.
[20:38:43] (c) 2009 Alex "Y_Less" Cole
[20:38:43] ===============================
[20:38:43] Loaded.
[20:38:43] Loading plugin: streamer.so
[20:38:43]
*** Streamer Plugin v2.5.2 by Incognito loaded ***
[20:38:43] Loaded.
[20:38:43] Loaded 3 plugins.
[20:38:43]
[20:38:43] Filter Scripts
[20:38:43] ---------------
[20:38:43] Loading filter script 'base.amx'...
[20:38:43]
--Base FS loaded.
[20:38:43] Loading filter script 'gl_actions.amx'...
[20:38:43] Loading filter script 'gl_property.amx'...
[20:38:43]
-----------------------------------
[20:38:43] Grand Larceny Property Filterscript
[20:38:43] -----------------------------------
[20:38:43] Loading filter script 'gl_realtime.amx'...
[20:38:43] Loaded 4 filter scripts.
[20:38:43] [MySQL] Connected (0) to 'root'@'127.0.0.1 via TCP/IP'.
[20:38:43] [MySQL] Server Version 5.0.51a-24+lenny5.
[20:38:43]
[20:38:43] lspd
[20:38:43] lspd
[20:38:43] lcn
[20:38:43] zivi
[20:38:43]
[20:38:43] Autos wurden Geladen
[20:38:43] Could Not Read Interiors file ( properties/interiors.txt )
[20:38:43] Reading File: blank
[20:38:43] Reading File: properties/houses.txt
[20:38:43] Reading File: properties/businesses.txt
[20:38:43] Reading File: properties/banks.txt
[20:38:43] Reading File: properties/police.txt
[20:38:43]
----------------------------------
[20:38:43] Blank Gamemode by your name here
[20:38:43] ----------------------------------
[20:38:43] Number of vehicle models: 2
[20:39:51] Incoming connection: 91.64.74.154:61766
[20:39:51] [join] [NCR]Ingo has joined the server (0:91.64.74.154)
[20:40:19] [MySQL] Error (0): Failed to exeute query. 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 '[NCR]Ingo' at line 1.
[20:40:19] [MySQL] Error (0): Function: mysql_store_result called when no prior successful query executed. 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 '[NCR]Ingo' at line 1.
[20:40:19] [MySQL] Error (0): Function: mysql_num_rows called when no result stored. 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 '[NCR]Ingo' at line 1.
[20:40:19] Player [NCR]Ingo logged in
[20:41:01] [part] [NCR]Ingo has left the server (0:1)
MFG
Ingo