hab ich ja auch so gemachaber des geht dorzdem net
Beiträge von x.X-Daniel-X.x
-
-
public OnGameModeExit()
{
mysql_close(mysql);
return 1;
}
so und das mysql ruft diese funktion auf:
mysql_init(LOG_ALL); -
mysql_init(LOG_ALL);
so das machen -
Code
Alles anzeigen/** * SA:MP MySQL v2.1 Functions * (c) Copyright 2011, StrickenKid * **/ #if defined __mysql_included #endinput #endif #define __mysql_included #pragma library mysql // plugin error id's #define P_ERROR_NONE 0 #define P_ERROR_INCPARAMCNT 1 #define P_ERROR_INCVALUE 2 #define P_ERROR_MAXCONN 3 #define P_ERROR_DBNOCONN 4 #define P_ERROR_NORES 5 #define P_ERROR_RES 6 #define P_ERROR_NOFIELD 7 #define P_ERROR_NOFIELDDATA 8 #define P_ERROR_NOROWDATA 9 #define P_ERROR_CANTALLOC 10 #define P_ERROR_NOCALLBACK 11 #define P_ERROR_NOQUERY 12 // mysql headers defines #define REFRESH_GRANT 1 #define REFRESH_LOG 2 #define REFRESH_TABLES 4 #define REFRESH_HOSTS 8 #define REFRESH_STATUS 16 #define REFRESH_THREADS 32 #define REFRESH_SLAVE 64 #define REFRESH_MASTER 128 // mysql error id's #define CR_ERROR_FIRST 2000 #define CR_UNKNOWN_ERROR 2000 #define CR_SOCKET_CREATE_ERROR 2001 #define CR_CONNECTION_ERROR 2002 #define CR_CONN_HOST_ERROR 2003 #define CR_IPSOCK_ERROR 2004 #define CR_UNKNOWN_HOST 2005 #define CR_SERVER_GONE_ERROR 2006 #define CR_VERSION_ERROR 2007 #define CR_OUT_OF_MEMORY 2008 #define CR_WRONG_HOST_INFO 2009 #define CR_LOCALHOST_CONNECTION 2010 #define CR_TCP_CONNECTION 2011 #define CR_SERVER_HANDSHAKE_ERR 2012 #define CR_SERVER_LOST 2013 #define CR_COMMANDS_OUT_OF_SYNC 2014 #define CR_NAMEDPIPE_CONNECTION 2015 #define CR_NAMEDPIPEWAIT_ERROR 2016 #define CR_NAMEDPIPEOPEN_ERROR 2017 #define CR_NAMEDPIPESETSTATE_ERROR 2018 #define CR_CANT_READ_CHARSET 2019 #define CR_NET_PACKET_TOO_LARGE 2020 #define CR_EMBEDDED_CONNECTION 2021 #define CR_PROBE_SLAVE_STATUS 2022 #define CR_PROBE_SLAVE_HOSTS 2023 #define CR_PROBE_SLAVE_CONNECT 2024 #define CR_PROBE_MASTER_CONNECT 2025 #define CR_SSL_CONNECTION_ERROR 2026 #define CR_MALFORMED_PACKET 2027 #define CR_WRONG_LICENSE 2028 #define CR_NULL_POINTER 2029 #define CR_NO_PREPARE_STMT 2030 #define CR_PARAMS_NOT_BOUND 2031 #define CR_DATA_TRUNCATED 2032 #define CR_NO_PARAMETERS_EXISTS 2033 #define CR_INVALID_PARAMETER_NO 2034 #define CR_INVALID_BUFFER_USE 2035 #define CR_UNSUPPORTED_PARAM_TYPE 2036 #define CR_SHARED_MEMORY_CONNECTION 2037 #define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038 #define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039 #define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040 #define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041 #define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042 #define CR_SHARED_MEMORY_MAP_ERROR 2043 #define CR_SHARED_MEMORY_EVENT_ERROR 2044 #define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045 #define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046 #define CR_CONN_UNKNOW_PROTOCOL 2047 #define CR_INVALID_CONN_HANDLE 2048 #define CR_SECURE_AUTH 2049 #define CR_FETCH_CANCELED 2050 #define CR_NO_DATA 2051 #define CR_NO_STMT_METADATA 2052 #define CR_NO_RESULT_SET 2053 #define CR_NOT_IMPLEMENTED 2054 #define CR_SERVER_LOST_EXTENDED 2055 #define CR_STMT_CLOSED 2056 #define CR_NEW_STMT_METADATA 2057 #define CR_ERROR_LAST 2057 // logging types #define INVALID_MYSQL_ID (-1) #define LOG_OFF (0) #define LOG_ALL (1) #define LOG_ONLY_ERRORS (2) // function defines #define mysql_reload(%1) mysql_refresh(REFRESH_GRANT, %1) // plugin callbacks forward OnMysqlQueryArray(resultid, extravars[], MySQL:handle); forward OnMysqlQuery(resultid, spareid, MySQL:handle); forward OnMysqlError(error[], errorid, MySQL:handle); // plugin natives native MySQL:mysql_init(logtype = LOG_ONLY_ERRORS, printerrors = 1); native mysql_connect(const host[], const user[], const pass[], const db[], MySQL:handle = (MySQL:0), auto_reconnect = 0); native mysql_close(MySQL:handle = (MySQL:0)); native mysql_refresh(options, MySQL:handle = (MySQL:0)); native mysql_select_db(const db[], MySQL:handle = (MySQL:0)); native mysql_query(const query[], resultid = (-1), spareid = (0), MySQL:handle = (MySQL:0)); native mysql_query_array(const query[], resultid = (-1), {Float,_}:extravars[], MySQL:handle = (MySQL:0)); native mysql_store_result(MySQL:handle = (MySQL:0)); native mysql_free_result(MySQL:handle = (MySQL:0)); native mysql_result_stored(MySQL:handle = (MySQL:0)); native mysql_fetch_field(const fieldname[], dest[], MySQL:handle = (MySQL:0)); native mysql_fetch_field_num(fieldnum, dest[], MySQL:handle = (MySQL:0)); native mysql_fetch_row(dest[], const splitter[] = "|", MySQL:handle = (MySQL:0)); native mysql_fetch_row_data(MySQL:handle = (MySQL:0)); native mysql_real_escape_string(const string[], dest[], MySQL:handle = (MySQL:0)); native mysql_num_rows(MySQL:handle = (MySQL:0)); native mysql_num_fields(MySQL:handle = (MySQL:0)); native mysql_affected_rows(MySQL:handle = (MySQL:0)); native mysql_insert_id(MySQL:handle = (MySQL:0)); native mysql_ping(MySQL:handle = (MySQL:0)); native mysql_error(dest[], MySQL:handle = (MySQL:0)); native mysql_errno(MySQL:handle = (MySQL:0)); native mysql_warning_count(MySQL:handle = (MySQL:0)); native mysql_info(dest[], MySQL:handle = (MySQL:0)); native mysql_stat(dest[], MySQL:handle = (MySQL:0)); native mysql_get_server_info(dest[], MySQL:handle = (MySQL:0)); native mysql_get_host_info(dest[], MySQL:handle = (MySQL:0)); native mysql_data_seek(rownum, MySQL:handle = (MySQL:0)); native mysql_set_character_set(const csname[], MySQL:handle = (MySQL:0)); native mysql_get_character_set(csname[], MySQL:handle = (MySQL:0)); native mysql_fetch_int(MySQL:handle = (MySQL:0)); native Float:mysql_fetch_float(MySQL:handle = (MySQL:0)); native mysql_fetch_string(dest[], MySQL:handle = (MySQL:0)); #if !defined split // split function - thanks to Blacklite stock split(const strsrc[], strdest[][], delimiter = '|') { new i, li, aNum, len, srclen = strlen(strsrc); while(i <= srclen) { if (strsrc[i] == delimiter || i == srclen) { len = strmid(strdest[aNum], strsrc, li, i, 128); strdest[aNum][len] = 0; li = i + 1; aNum++; } i++; } } #endif
-
Hallo com,
ich hab meinen server nun auf mysql umgeschrieben.
ich bekomme folgende erorrs in der server log:Code[19:34:24] [MySQL] Error (2): Function: mysql_close called when not connected to any database. [19:34:36] Function: mysql_connect called with incorrect parameter count. [19:34:36] AllowAdminTeleport() : function is deprecated. Please see OnPlayerClickMap() [19:34:36] ---------------------------------- [19:34:36] Reality Real Life Gamemode v1.0 [19:34:36] ---------------------------------- [19:34:36] Number of vehicle models: 32
meine zeille im script:
mysql = mysql_init(LOG_ALL);
mysql_connect("server", "user", "pw", "db", mysql); -
Hallo,
wollte fragen ob ich mein carsystem so richt hab beim Speichern
stock CarSpeichern(playerid)
{
for(new i = 0; i < 3; i++)
{
new Spielerdatei[64];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Autodatei,sizeof(Autodatei),"/Autos/%s_Auto_%d.txt",name,i);
dini_IntSet(Autodatei,"Farbe1",GetPVarInt(playeri,i,"Farbe1"));
dini_IntSet(Autodatei,"Farbe2",GetPVarInt(playeri,i,"Farbe2"));
dini_IntSet(Autodatei,"Lock",GetPVarInt(playeri,i,"Lock"));
dini_IntSet(Autodatei,"posx",GetPVarInt(playeri,i,"posx"));
dini_IntSet(Autodatei,"posy",GetPVarInt(playeri,i,"posy"));
dini_IntSet(Autodatei,"posz",GetPVarInt(playeri,i,"posz"));
dini_IntSet(Autodatei,"posa",GetPVarInt(playeri,i,"posa"));
dini_IntSet(Autodatei,"HP",GetPVarInt(playeri,i,"HP"));
dini_IntSet(Autodatei,"Nummernschild",GetPVarInt(playeri,i,"Nummernschild"));
dini_IntSet(Autodatei,"Spoiler",GetPVarInt(playeri,i,"Spoiler"));
dini_IntSet(Autodatei,"Hood",GetPVarInt(playeri,i,"Hood"));
dini_IntSet(Autodatei,"Roof",GetPVarInt(playeri,i,"Roof"));
dini_IntSet(Autodatei,"Sideskirt",GetPVarInt(playeri,i,"Sideskirt"));
dini_IntSet(Autodatei,"Roof",GetPVarInt(playeri,i,"Roof"));
dini_IntSet(Autodatei,"Roof",GetPVarInt(playeri,i,"Roof"));
dini_IntSet(Autodatei,"Roof",GetPVarInt(playeri,i,"Roof"));
dini_IntSet(Autodatei,"Roof",GetPVarInt(playeri,i,"Roof"));
dini_IntSet(Autodatei,"Roof",GetPVarInt(playeri,i,"Roof"));
dini_IntSet(Autodatei,"Roof",GetPVarInt(playeri,i,"Roof"));
}}
-
ist natürlich mehr arbeit, da du die "arrays" etwas komplizierter erstellen und abfragen/benutzen musst.
ok Danke were gut wenn mir jemand des mit dem lade zeigt nor macht man es ja so
stock loadcar(playerid)
{
new Spielerdatei[64];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Spielerdatei,sizeof(Spielerdatei),"/cars/%s.txt",name);
SetPVarInt(playerid,"Carlock",dini_Int(Spielerdatei,"Carlock"));
}
ist des so richtig? -
hallo
ich bin mom überlegen wie mann einm carsystem mit Pvar machen kann
kann mir jemand das erklären wie mann ein car system mit PVars macht
mfg
Daniel -
ich habe eine frage weil ich für die fraktionen SAPD, Army, FBI und Medic ein frations autoschieß befehl gemacht habe doch dieser geht leider nicht
if(strcmp(cmdtext, "/flock", true) == 0)
{
new Float:dtc_X,Float:dtc_Y,Float:dtc_Z;
if(isPlayerInFrakt(playerid,1) || isPlayerInFrakt(playerid,2) || isPlayerInFrakt(playerid,4))
if(IsPlayerInAnyVehicle(playerid))
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(Status == 0)
{
if(IsPlayerInAnyVehicle(i))
{
GameTextForPlayer(playerid, "~r~Fahrzeug abgeschlossen", 5000, 6);
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
Status = 1;
}
}
else if
(Status == 1)
{
GetPlayerPos(playerid,dtc_X,dtc_Y,dtc_Z);
if(IsPlayerInRangeOfPoint(i,10,dtc_X,dtc_Y,dtc_Z))
{
GameTextForPlayer(playerid, "~g~Fahrzeug aufgeschlossen", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
Status = 0;
}
}
}
return 1;
}
were über hilfe sehr dankbar -
ja es geht aber ersteht nach ca 1 milisekunde wider auf
-
geht immer noch net hier kuck is scribt
ocmd:tazer(playerid,params[])
{
if(isPlayerInFrakt(playerid,1) || isPlayerInFrakt(playerid,2) || isPlayerInFrakt(playerid,4))
if(GetPVarInt(playerid,"FRank")<= 2)return SendClientMessage(playerid,ROT,"Rang zu niedrig!");
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
new pID;
if(IsPlayerConnected(playerid))
{
if(sscanf(params,"i",pID))
{
SendClientMessage(playerid,WEISS,"/tazer [playerid]");
return 1;
}
if(!IsPlayerConnected(pID))return SendClientMessage(playerid,ROT,"Der Spieler ist Offline!");
if(IsPlayerInAnyVehicle(pID))return SendClientMessage(playerid,ROT,"Der Spieler ist in einem Auto!");
if(IsPlayerInRangeOfPoint(playerid,8,x,y,z))
{
ApplyAnimation(pID,"CRACK","crackdeth2",4.0, 1, 0, 0, 0, 0);
TogglePlayerControllable(pID,0);
GameTextForPlayer(pID,"~r~Getazert",30000,0);
SendClientMessage(playerid,ROT,"Du hast den Player Getazert!");
SetTimerEx("tazed",30000,0,"i",pID);
SetPVarInt(pID,"Tazed",1);
}
}
}
return 1;
} -
geht net tut sich nix
-
ocmd:tazer(playerid,params[])
{
if(isPlayerInFrakt(playerid,1) || isPlayerInFrakt(playerid,2) || isPlayerInFrakt(playerid,4))
if(GetPVarInt(playerid,"FRank")<= 2)return SendClientMessage(playerid,ROT,"Rang zu niedrig!");
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
new pID;
if(IsPlayerConnected(playerid))
{
if(sscanf(params,"i",pID))
{
SendClientMessage(playerid,WEISS,"/tazer [playerid]");
return 1;
}
if(!IsPlayerConnected(pID))return SendClientMessage(playerid,ROT,"Der Spieler ist Offline!");
if(IsPlayerInAnyVehicle(pID))return SendClientMessage(playerid,ROT,"Der Spieler ist in einem Auto!");
if(IsPlayerInRangeOfPoint(playerid,8,x,y,z))
{
TogglePlayerControllable(pID,0);
GameTextForPlayer(pID,"~r~Getazert",30000,0);
SendClientMessage(playerid,ROT,"Du hast den Player Getazert!");
SetTimerEx("tazed",30000,0,"i",pID);
SetPVarInt(pID,"Tazed",1);
}
}
}
return 1;
}//Publick tazed
public tazed(pID)
{
TogglePlayerControllable(pID,1);
SetPVarInt(pID,"Tazed",0);
}
kann mir jemand die animation "crackdeth2" einbauen so das sie bei erstenmal /tazer eingeben los geht und das diese Animation alles spieler sehen können
mfg
Daniel -
hallo Breadfish
ich habe versuch einen eigennen /tazer befeh mit ocmd zu machen nur leider weis ich einfach nicht wie ich das mit dem timer machen soll
10 Sekunden nach dem tzazed soll die person entfreezt werden und die anmation wo mann auf den boden liegt gestopt werde.
ocmd:tazer(playerid,params[])
{
if(isPlayerInFrakt(playerid,1) || isPlayerInFrakt(playerid,2) || isPlayerInFrakt(playerid,4))
{
new pID;
if(IsPlayerConnected(playerid))
{
if(sscanf(params,"i",pID))
{
SendClientMessage(playerid,WEISS,"/tazer [playerid]");
return 1;
}
if(!IsPlayerConnected(pID))return SendClientMessage(playerid,ROT,"Der Spieler ist Offline!");
if(IsPlayerInAnyVehicle(pID))return SendClientMessage(playerid,ROT,"Der Spieler ist in einem Auto!");
TogglePlayerControllable(playerid,0);
SetTimer("tazed",7200000,1);
TogglePlayerControllable(playerid,1);
}
}
return 1
}
mfg Daniel 123 -
Also
da eh immer nur copy and paste eingesetzt wird helfe ich nicht -
ok Danke für eure hilfe
//edit habe die kdonaten -
-
also das geht so
AddStaticVehicleEx(427,1526.50000000,-1644.90002441,6.09999990,180.00000000,79,1,Spwan Zeit);//zeit in mili Sekunden
also z.B für 5 min
AddStaticVehicleEx(427,1526.50000000,-1644.90002441,6.09999990,180.00000000,79,1,300000);
mfg Daniel123 -
Danke echte dir
-
wie geht das mit sscanf?
PID ist der wo die licens sehen soll