Musst es ansonsten mit GivePlayerMoney dem Spieler geben.
Ich glaube das sollte so sein, oder etwa nicht?
Musst es ansonsten mit GivePlayerMoney dem Spieler geben.
Ich glaube das sollte so sein, oder etwa nicht?
Dann habe ich das verwechselt (>.<)'
Log dazu zu groß
Du sollst natürlich nur den Abschnitt posten, nachdem du den Befehl eingegeben hast!
Tag Mistach bedeutet nicht dass du sie doppelt hast, sondern das du ein Argument (Parameter) falsch eingegeben/vergessen hast.
Z.B.:
SendClientMessage(playerid,FARBE,"TEXT");
und du machst
SendClientMessage(playerid,"TEXT");
Also fehlt der Parameter 'FARBE'.
Was steht denn in der normalen Log?
"
Lad mal dein Script bei Pastebin hoch, vorher können wir dir nicht helfen.
"
Total schwachsinnig, da mein Selfmade-Gamemode über 40.000 Zeilen hat
"Normalerweise kommt dieser Fehler, wenn du in deinem Gamemode kein main hast.
Füge das, falls du es nicht hast, zu deinem Gamemode hinzu (unter den Includes):"
Das habe ich im Internet auch schon gelesen, jedoch war es schon von Anfang an drin und auch wenn es direkt unter den Includes steht,
treten die Fehlermeldungen immer noch auf
Hey Leute,
ich habe ein Problem mit einem Timer.
Undzwar wird die Variable "Zeit" irgendwie ganz komisch abgezogen bzw. geändert.
Habt ihr eine Idee wieso?
Hier der Timer (Code):
forward UpdateZones();
public UpdateZones()
{
for(new player; player < MAX_PLAYERS; player++)
{
for(new i; i<sizeof(Zonen); i++)
{
GangZoneHideForPlayer(player,Zone[i]);
new color;
if(Zonen[i][gOwner] == 0){color=0xFEFEFEA8;}
if(Zonen[i][gOwner] == 10){color=0x007600A8;}
if(Zonen[i][gOwner] == 11){color=0x8C00FFA8;}
if(Zonen[i][gOwner] == 12){color=0x6E6E6EA8;}
if(Zonen[i][gOwner] == 13){color=0x000000A8;}
GangZoneShowForPlayer(player, Zone[i], color);
if(Zonen[i][gOn] == 1)
{
if(Zonen[i][gAngreifer] == 0){color=0xFEFEFEA8;}
if(Zonen[i][gAngreifer] == 10){color=0x007600A8;}
if(Zonen[i][gAngreifer] == 11){color=0x8C00FFA8;}
if(Zonen[i][gAngreifer] == 12){color=0x6E6E6EA8;}
if(Zonen[i][gAngreifer] == 13){color=0x000000A8;}
GangZoneFlashForPlayer(player,Zone[i],color);
}
if(Zonen[i][gCoolDown] > 0)
{
Zonen[i][gCoolDown] --;
}
if(Zonen[i][capture_cd] > 0)
{
Zonen[i][capture_cd] --;
}
if(Zonen[i][gZeit] > 0)
{
Zonen[i][gZeit] --;
new minutes;
new seconds;
new ktimestr[32];
new kstr[16];
if(Zonen[i][gZeit] > 59)
{
minutes = floatround(Zonen[i][gZeit]/60);
seconds = floatround(Zonen[i][gZeit] - minutes*60);
if(seconds>9)format(kstr,sizeof(kstr),"%d:%d",minutes,seconds);
else format(kstr,sizeof(kstr),"%d:0%d",minutes,seconds);
}
else
{
seconds = floatround(Zonen[i][gZeit]);
if(seconds>9)format(kstr,sizeof(kstr),"0:%d",seconds);
else format(kstr,sizeof(kstr),"0:0%d",seconds);
}
format(ktimestr, sizeof ktimestr, "%s",kstr);
TextDrawSetString(GWZeit[player],ktimestr);
}
if(Zonen[i][gZeit] == 0)
{
Zonen[i][gOn] = 0;
if(Zonen[i][gStand2] > Zonen[i][gStand1])
{
Zonen[i][gOwner] = Zonen[i][gAngreifer];
}
new fname[20];
switch(Zonen[i][gOwner])
{
case 10:{fname = "Grove Street";}
case 11:{fname = "Ballas";}
case 12:{fname = "Al Quaida";}
case 13:{fname = "La Cosa Nostra";}
}
new string[128];
format(string,sizeof(string),"[GANGFIGHT Der Gewinner des Gangwars ist: %s, die mit %d : %d gewonnen haben.",fname,Zonen[i][gStand1],Zonen[i][gStand2]);
SCMTA(COLOR_YELLOW,string);
Zonen[i][gStand2] = 0;
Zonen[i][gStand1] = 0;
Zonen[i][gZeit] = -1;
Zonen[i][gAngreifer]=0;
Zonen[i][gCoolDown] = 4200;
TextDrawHideForPlayer(player,GWBox[player]);
TextDrawHideForPlayer(player,GWText[player]);
TextDrawHideForPlayer(player,GWAngreifer[player]);
TextDrawHideForPlayer(player,GWVerteidiger[player]);
TextDrawHideForPlayer(player,GWAngrPunkte[player]);
TextDrawHideForPlayer(player,GWVertPunkte[player]);
TextDrawHideForPlayer(player,GWZeit[player]);
TextDrawHideForPlayer(player,GWZeitText[player]);
GangwarAktiv --;
}
}
}
return 1;
}
Habe den Fehler gefunden
Danke Jeffry, denn ich hatte tatsächlich die Kassen gespeichert, bevor deren Werte gesetzt wurden, also waren sie automatisch auf 0 !
Danke nochmal !
Ehm...mal eine doofe Frage, hast du überhaupt mit INSERT INTO was in die Datenbank geschrieben?
Ich weiß nicht genau was du damit meinst
Ich habe sobald jemand etwas einzahlt mit dem "UPDATE" Code gearbeitet, da ich im Script mit Variablen für die Kassen arbeite. d.h.:
Der Code beim Einzahlen:
pInv[playerid][Marihuana] =pInv[playerid][Marihuana] - wert;
KassenInfo[10][k_Gras] += wert;
new str[128];
format(str,sizeof(str),"%s hat %ig Marihuana in die Fraktionskasse gezahlt! Stand: %ig",SpielerName(playerid),wert,KassenInfo[10][k_Gras]);
FrakCast(COLOR_YELLOW,str,10);
KassenSpeichern();
FrakLog10(str);
Und so wird es dann gespeichert:
stock KassenSpeichern()
{
new query[256];
format(query, sizeof(query), "UPDATE `kassen` SET `Geld` = '%i', `Mats` = '%i', `Gras` = '%i', `Heroin` = '%i' WHERE `Name` = 'GS'", KassenInfo[10][k_Geld],KassenInfo[10][k_Mats],KassenInfo[10][k_Gras],KassenInfo[10][k_Heroin]);
mysql_query(query);
format(query, sizeof(query), "UPDATE `kassen` SET `Geld` = '%i', `Mats` = '%i', `Gras` = '%i', `Heroin` = '%i' WHERE `Name` = 'BALLAS'", KassenInfo[11][k_Geld],KassenInfo[11][k_Mats],KassenInfo[11][k_Gras],KassenInfo[11][k_Heroin]);
mysql_query(query);
usw...
return 1;
}
Hmm, kannst du dann bitte folgendes machen?
Ich habe die Werte eingetragen und den Server neugestartet.
Die Werte wurden ebenfalls wieder auf 0 gesetzt und folgendes steht nun in der Log:
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "UPDATE `kassen` SET `Geld` = '0', `Mats` = '0', `Gras` = '0', `Heroin` = '0' WHERE `Name` = 'GS'" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "UPDATE `kassen` SET `Geld` = '0', `Mats` = '0', `Gras` = '0', `Heroin` = '0' WHERE `Name` = 'BALLAS'" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "UPDATE `kassen` SET `Geld` = '0', `Mats` = '0', `Gras` = '0', `Heroin` = '0', `C4` = '0' WHERE `Name` = 'TERROR'" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "UPDATE `kassen` SET `Geld` = '0', `Mats` = '0', `Gras` = '0', `Heroin` = '0' WHERE `Name` = 'LCN'" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "UPDATE `kassen` SET `Geld` = '0' WHERE `Name` = 'Jackpot'" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "UPDATE `kassen` SET `Geld` = '0' WHERE `Name` = 'LSPD'" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "UPDATE `kassen` SET `Geld` = '0' WHERE `Name` = 'BND'" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "UPDATE `kassen` SET `Geld` = '0' WHERE `Name` = 'Hitmen'" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "UPDATE `kassen` SET `Geld` = '0' WHERE `Name` = 'Army'" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "UPDATE `kassen` SET `Geld` = '0' WHERE `Name` = 'Medic'" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "UPDATE `kassen` SET `Geld` = '0' WHERE `Name` = 'OAmt'" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "UPDATE `kassen` SET `Geld` = '0' WHERE `Name` = 'News'" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "1" with result: "1".
Alles anzeigen
Des Weiteren steht ein paar Zeilen da unter folgendes:
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Geld" with result: "Geld".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "LCN" with result: "LCN".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Geld` FROM `kassen` WHERE `Name` = 'LCN' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Mats" with result: "Mats".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "LCN" with result: "LCN".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Mats` FROM `kassen` WHERE `Name` = 'LCN' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Heroin" with result: "Heroin".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "LCN" with result: "LCN".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Heroin` FROM `kassen` WHERE `Name` = 'LCN' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Gras" with result: "Gras".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "LCN" with result: "LCN".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Gras` FROM `kassen` WHERE `Name` = 'LCN' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Geld" with result: "Geld".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "GS" with result: "GS".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Geld` FROM `kassen` WHERE `Name` = 'GS' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Mats" with result: "Mats".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "GS" with result: "GS".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Mats` FROM `kassen` WHERE `Name` = 'GS' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Gras" with result: "Gras".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "GS" with result: "GS".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Gras` FROM `kassen` WHERE `Name` = 'GS' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Heroin" with result: "Heroin".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "GS" with result: "GS".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Heroin` FROM `kassen` WHERE `Name` = 'GS' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Geld" with result: "Geld".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "BALLAS" with result: "BALLAS".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Geld` FROM `kassen` WHERE `Name` = 'BALLAS' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Mats" with result: "Mats".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "BALLAS" with result: "BALLAS".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Mats` FROM `kassen` WHERE `Name` = 'BALLAS' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Heroin" with result: "Heroin".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "BALLAS" with result: "BALLAS".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Heroin` FROM `kassen` WHERE `Name` = 'BALLAS' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Gras" with result: "Gras".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "BALLAS" with result: "BALLAS".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Gras` FROM `kassen` WHERE `Name` = 'BALLAS' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Geld" with result: "Geld".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "TERROR" with result: "TERROR".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Geld` FROM `kassen` WHERE `Name` = 'TERROR' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Mats" with result: "Mats".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "TERROR" with result: "TERROR".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Mats` FROM `kassen` WHERE `Name` = 'TERROR' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Gras" with result: "Gras".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "TERROR" with result: "TERROR".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Gras` FROM `kassen` WHERE `Name` = 'TERROR' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "C4" with result: "C4".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "TERROR" with result: "TERROR".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `C4` FROM `kassen` WHERE `Name` = 'TERROR' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Heroin" with result: "Heroin".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "TERROR" with result: "TERROR".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Heroin` FROM `kassen` WHERE `Name` = 'TERROR' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Geld" with result: "Geld".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Jackpot" with result: "Jackpot".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Geld` FROM `kassen` WHERE `Name` = 'Jackpot' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Geld" with result: "Geld".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "News" with result: "News".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Geld` FROM `kassen` WHERE `Name` = 'News' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Geld" with result: "Geld".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "OAmt" with result: "OAmt".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Geld` FROM `kassen` WHERE `Name` = 'OAmt' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Geld" with result: "Geld".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Medic" with result: "Medic".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Geld` FROM `kassen` WHERE `Name` = 'Medic' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Geld" with result: "Geld".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Army" with result: "Army".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Geld` FROM `kassen` WHERE `Name` = 'Army' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Geld" with result: "Geld".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Hitmen" with result: "Hitmen".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Geld` FROM `kassen` WHERE `Name` = 'Hitmen' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Geld" with result: "Geld".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "BND" with result: "BND".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Geld` FROM `kassen` WHERE `Name` = 'BND' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "kassen" with result: "kassen".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Geld" with result: "Geld".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "Name" with result: "Name".
[Thu Mar 5 12:59:46 2015] Function: mysql_real_esacpe_string executed: "LSPD" with result: "LSPD".
[Thu Mar 5 12:59:46 2015] Function: mysql_query executed: "SELECT `Geld` FROM `kassen` WHERE `Name` = 'LSPD' LIMIT 1" with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_store_result executed with result: "1"
[Thu Mar 5 12:59:46 2015] Function: mysql_fetch_int executed with result: "0".
[Thu Mar 5 12:59:46 2015] Function: mysql_free_result executed.
Alles anzeigen
Der PAWN-Code dazu:
for(new i=0;i<14;i++)
{
KassenInfo[i][k_Geld] = 0;
KassenInfo[i][k_Mats] = 0;
KassenInfo[i][k_Heroin] = 0;
KassenInfo[i][k_Gras] = 0;
KassenInfo[i][k_C4] = 0;
}
KassenInfo[13][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "LCN");
KassenInfo[13][k_Mats] = mysql_GetInt("kassen", "Mats", "Name", "LCN");
KassenInfo[13][k_Heroin] = mysql_GetInt("kassen", "Heroin", "Name", "LCN");
KassenInfo[13][k_Gras] = mysql_GetInt("kassen", "Gras", "Name", "LCN");
//
KassenInfo[10][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "GS");
KassenInfo[10][k_Mats] = mysql_GetInt("kassen", "Mats", "Name", "GS");
KassenInfo[10][k_Gras] = mysql_GetInt("kassen", "Gras", "Name", "GS");
KassenInfo[10][k_Heroin] = mysql_GetInt("kassen", "Heroin", "Name", "GS");
//
KassenInfo[11][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "BALLAS");
KassenInfo[11][k_Mats] = mysql_GetInt("kassen", "Mats", "Name", "BALLAS");
KassenInfo[11][k_Heroin] = mysql_GetInt("kassen", "Heroin", "Name", "BALLAS");
KassenInfo[11][k_Gras] = mysql_GetInt("kassen", "Gras", "Name", "BALLAS");
//
KassenInfo[12][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "TERROR");
KassenInfo[12][k_Mats] = mysql_GetInt("kassen", "Mats", "Name", "TERROR");
KassenInfo[12][k_Gras] = mysql_GetInt("kassen", "Gras", "Name", "TERROR");
KassenInfo[12][k_C4] = mysql_GetInt("kassen", "C4", "Name", "TERROR");
KassenInfo[12][k_Heroin] = mysql_GetInt("kassen", "Heroin", "Name", "TERROR");
//
KassenInfo[0][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "Jackpot");
KassenInfo[9][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "News");
KassenInfo[7][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "OAmt");
KassenInfo[6][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "Medic");
KassenInfo[4][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "Army");
KassenInfo[3][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "Hitmen");
KassenInfo[2][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "BND");
KassenInfo[1][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "LSPD");
Wie ich soweit erkennen kann, werden also die Werte vorher auf 0 gesetzt, oder irre ich mich? :o
Ahh, achso.
Werden die Sachen wie "Heroin" und "Gras" richtig geladen? Poste ggf. mal den MySQL Log vom starten des Servers.
Möglicherweise wird der Code gar nicht aufgerufen.
Hey Jeffry,
ich habe jetzt den Server nur einmal gestoppt, selbst da werden die MySQL Werte auf 0 gesetzt...
Genau so ist es, wenn ich den Server neustarte
Bei "OnGameModeExit" steht soweit nichts in Verbindung mit dem Kassen System, aber wieso werden dann alle Werte auf 0 gesetzt?!
Ich verzweifle langsam...
er printet mir, dass es "0" ist...
Sprich irgendwo anders ist noch ein Fehler
Hey Leute,
ich habe ein Problem mit dieser Abfrage in einem 1-sekündigem Timer (der sich jederzeit wiederholt):
if(AutoPruf[i] == 1 || BikePruf[i] == 1 || LKWPruf[i] == 1)
{
if(IsPlayerInAnyVehicle(i))
{
new fahrzeug = GetPlayerVehicleID(i);
new geschwindigkeit = GetPlayerSpeed(i);
if(geschwindigkeit > 85)
{
if(PrufFehler[i] == 4)
{
SCM(i,ROT,"Du hast 5 Fehler gemacht und bist somit durch die Prüfung gefallen!");
SCM(i,ROT,"Versuche das nächste mal langsamer zu fahren!");
AutoPruf[i] = 0;
BikePruf[i] = 0;
LKWPruf[i] = 0;
PrufFehler[i] = 0;
s_SetVehicleToRespawn(fahrzeug,-1);
PlaySound(i,5201);
s_SetPlayerPos(i,2433.8877,-2132.1987,13.5469);
return 1;
}
else
{
PrufFehler[i] ++;
PlaySound(i,5201);
SCM(i,F_O,"Fehler! Halte dich an die Geschwindigkeit von 80km/h!");
SendClientMessagef(i,F_O,"Fehler insgesamt: %i von 5.",PrufFehler[i]);
}
}
}
}
Speed Stock:
stock GetPlayerSpeed(playerid)
{
new Float:ST[4];
if(IsPlayerInAnyVehicle(playerid))
GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 179.28625;
return floatround(ST[3]);
}
Undzwar wird jede Sekunde ein Fehlerpunkt addiert...
Also ich glaube er hat dann ein Problem mit der Abfrage (GetPlayerSpeed) !
Dankeschön
@Rocky:
Klar bringt die SuFU was, aber bei dem aktuellen Stand hatte ich nichts brauchbares gefunden!
Hey Leute,
ich bastel gerade ein klassisches Fahrschulensystem zusammen und möchte eine Abfrage einbauen, dass sobald der Spieler schneller als 85 km/h fährt
einen Fehler bekommt...
Das was mich daran hindert ist, dass ich nicht genau weiß wie ich die Geschwindigkeit des Spielers ausrechnen bzw. abfragen kann
Habt ihr eine Idee?
Er speichert es ja richtig!
Sprich nach jedem mal wenn ich etwas ein- oder ausgezahlt habe, wurde der Wert in der DB auch dementsprechend geändert!
Nur wenn ich einen restart gemacht habe, wurden die Werte alle auf 0 gesetzt!
Immer nachdem etwas ein- oder ausgezahlt wurde
Hey Leute,
ich habe seit längerem schon ein Problem, was ich einfach nicht gelöst bekomme...
Da mein Script viel mit MySQL arbeitet und es soweit auch alles sehr gut klappt, dachte ich auch das das so bleibt, doch
schon seit geraumer Zeit beschäftigt mich mein Fraktionskassen-System, welches nach einem restart immer zurück auf 0 gesetzt wird.
Dabei habe ich eigentlich nichts im Script so eingegeben...
Das einzige was passiert:
Speicherung-Stock:
stock KassenSpeichern()
{
new query[128];
format(query, sizeof(query), "UPDATE `kassen` SET `Geld` = '%i', `Mats` = '%i', `Gras` = '%i', `Heroin` = '%i' WHERE `Name` = 'GS'", KassenInfo[10][k_Geld],KassenInfo[10][k_Mats],KassenInfo[10][k_Gras],KassenInfo[10][k_Heroin]);
mysql_query(query);
format(query, sizeof(query), "UPDATE `kassen` SET `Geld` = '%i', `Mats` = '%i', `Gras` = '%i', `Heroin` = '%i' WHERE `Name` = 'BALLAS'", KassenInfo[11][k_Geld],KassenInfo[11][k_Mats],KassenInfo[11][k_Gras],KassenInfo[11][k_Heroin]);
mysql_query(query);
format(query, sizeof(query), "UPDATE `kassen` SET `Geld` = '%i', `Mats` = '%i', `Gras` = '%i', `Heroin` = '%i', `C4` = '%i' WHERE `Name` = 'TERROR'", KassenInfo[12][k_Geld],KassenInfo[12][k_Mats],KassenInfo[12][k_Gras],KassenInfo[12][k_Heroin],KassenInfo[12][k_C4]);
mysql_query(query);
format(query, sizeof(query), "UPDATE `kassen` SET `Geld` = '%i', `Mats` = '%i', `Gras` = '%i', `Heroin` = '%i' WHERE `Name` = 'LCN'", KassenInfo[13][k_Geld],KassenInfo[13][k_Mats],KassenInfo[13][k_Gras],KassenInfo[13][k_Heroin]);
mysql_query(query);
format(query, sizeof(query), "UPDATE `kassen` SET `Geld` = '%i' WHERE `Name` = 'Jackpot'", KassenInfo[0][k_Geld]);
mysql_query(query);
format(query, sizeof(query), "UPDATE `kassen` SET `Geld` = '%i' WHERE `Name` = 'LSPD'", KassenInfo[1][k_Geld]);
mysql_query(query);
format(query, sizeof(query), "UPDATE `kassen` SET `Geld` = '%i' WHERE `Name` = 'BND'", KassenInfo[2][k_Geld]);
mysql_query(query);
format(query, sizeof(query), "UPDATE `kassen` SET `Geld` = '%i' WHERE `Name` = 'Hitmen'", KassenInfo[3][k_Geld]);
mysql_query(query);
format(query, sizeof(query), "UPDATE `kassen` SET `Geld` = '%i' WHERE `Name` = 'Army'", KassenInfo[4][k_Geld]);
mysql_query(query);
format(query, sizeof(query), "UPDATE `kassen` SET `Geld` = '%i' WHERE `Name` = 'Medic'", KassenInfo[6][k_Geld]);
mysql_query(query);
format(query, sizeof(query), "UPDATE `kassen` SET `Geld` = '%i' WHERE `Name` = 'OAmt'", KassenInfo[7][k_Geld]);
mysql_query(query);
format(query, sizeof(query), "UPDATE `kassen` SET `Geld` = '%i' WHERE `Name` = 'News'", KassenInfo[9][k_Geld]);
mysql_query(query);
return 1;
}
OnGameModeInit (hier werden auch die ganzen Sachen geladen):
for(new i=0;i<14;i++)
{
KassenInfo[i][k_Geld] = 0;
KassenInfo[i][k_Mats] = 0;
KassenInfo[i][k_Heroin] = 0;
KassenInfo[i][k_Gras] = 0;
KassenInfo[i][k_C4] = 0;
}
KassenInfo[13][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "LCN");
KassenInfo[13][k_Mats] = mysql_GetInt("kassen", "Mats", "Name", "LCN");
KassenInfo[13][k_Heroin] = mysql_GetInt("kassen", "Heroin", "Name", "LCN");
KassenInfo[13][k_Gras] = mysql_GetInt("kassen", "Gras", "Name", "LCN");
//
KassenInfo[10][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "GS");
KassenInfo[10][k_Mats] = mysql_GetInt("kassen", "Mats", "Name", "GS");
KassenInfo[10][k_Gras] = mysql_GetInt("kassen", "Gras", "Name", "GS");
KassenInfo[10][k_Heroin] = mysql_GetInt("kassen", "Heroin", "Name", "GS");
//
KassenInfo[11][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "BALLAS");
KassenInfo[11][k_Mats] = mysql_GetInt("kassen", "Mats", "Name", "BALLAS");
KassenInfo[11][k_Heroin] = mysql_GetInt("kassen", "Heroin", "Name", "BALLAS");
KassenInfo[11][k_Gras] = mysql_GetInt("kassen", "Gras", "Name", "BALLAS");
//
KassenInfo[12][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "TERROR");
KassenInfo[12][k_Mats] = mysql_GetInt("kassen", "Mats", "Name", "TERROR");
KassenInfo[12][k_Gras] = mysql_GetInt("kassen", "Gras", "Name", "TERROR");
KassenInfo[12][k_C4] = mysql_GetInt("kassen", "C4", "Name", "TERROR");
KassenInfo[12][k_Heroin] = mysql_GetInt("kassen", "Heroin", "Name", "TERROR");
//
KassenInfo[0][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "Jackpot");
KassenInfo[9][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "News");
KassenInfo[7][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "OAmt");
KassenInfo[6][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "Medic");
KassenInfo[4][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "Army");
KassenInfo[3][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "Hitmen");
KassenInfo[2][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "BND");
KassenInfo[1][k_Geld] = mysql_GetInt("kassen", "Geld", "Name", "LSPD");
Bei OnGameModeExit habe ich soweit nichts mit dem F-Kassen System eingebaut...
Ich tüftel da schon etwas länger dran rum, komme aber nicht weiter...
Habt ihr eine Idee?