Guten Morgen
@Jeffry Wenn du zeit hast
Ich habe derzeit probleme mit mein Fraktionssystem:
Wie sieht der Fehler aus:
Spieler A = Admin setzt Spieler B zum LSPD-Leader.
Spieler B = benutzt /spawnchange um sein Spawn zum LSPD-Spawn zu setzen.
Spieler B = Stirbt und spawnt nicht am LSPD-Spawn.
Spieler B = Loggt sich aus sollte normal alles gespeichert werden.
Spieler B = Loggt sich wieder ein und ist kein Leader vom LSPD ,mehr.
Hier die Logs:
MYSQL-Log
Code
[10/14/16 06:34:38] [INFO] changed log level from 'warning, error' to 'debug, info, warning, error'
[10/14/16 06:35:58] [DEBUG] mysql_format(1, 0xF5488734, 128, "SELECT id FROM Accounts WHERE Name = '%e'") (Nitradoscript.p:270)
[10/14/16 06:35:58] [DEBUG] CHandle::EscapeString(this=0x9953ab0, src='Tiriago')
[10/14/16 06:35:58] [DEBUG] CConnection::EscapeString(src='Tiriago', this=0x9a446d0, connection=0x9ac5178)
[10/14/16 06:35:58] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'Tiriago'
[10/14/16 06:35:58] [DEBUG] mysql_format: return value: '46' (Nitradoscript.p:270)
[10/14/16 06:35:58] [DEBUG] mysql_pquery(1, "SELECT id FROM Accounts WHERE Name = 'Tiriago'", "OnUserCheck", "d") (Nitradoscript.p:271)
[10/14/16 06:35:58] [DEBUG] CCallback::Create(amx=0x9ac4d38, name='OnUserCheck', format='d', params=0xf548871c, param_offset=5)
[10/14/16 06:35:58] [DEBUG] CCallback::Create - callback index for 'OnUserCheck': 32
[10/14/16 06:35:58] [DEBUG] processing specifier 'd' with parameter index 0
[10/14/16 06:35:58] [DEBUG] retrieved and pushed value '0'
[10/14/16 06:35:58] [INFO] Callback 'OnUserCheck' set up for delayed execution.
[10/14/16 06:35:58] [DEBUG] created delayed callback with 1 parameter
[10/14/16 06:35:58] [DEBUG] CHandle::Execute(this=0x9953ab0, type=2, query=0x9b14030)
[10/14/16 06:35:58] [DEBUG] CConnectionPool::Queue(query=0x9b14030, this=0x9a4b490)
[10/14/16 06:35:58] [DEBUG] CHandle::Execute - return value: true
[10/14/16 06:35:58] [DEBUG] CConnection::Execute(query=0x9b14030, this=0xf4b5d008, connection=0x9aebb00)
[10/14/16 06:35:58] [DEBUG] mysql_pquery: return value: '1' (Nitradoscript.p:271)
[10/14/16 06:35:58] [DEBUG] CQuery::Execute(this=0x9b14030, connection=0x9aebb00)
[10/14/16 06:35:58] [INFO] query "SELECT id FROM Accounts WHERE Name = 'Tiriago'" successfully executed within 0.309 milliseconds
[10/14/16 06:35:58] [DEBUG] CResultSet::Create(connection=0x9aebb00, query_str='SELECT id FROM Accounts WHERE Name = 'Tiriago'')
[10/14/16 06:35:58] [DEBUG] created new resultset '0xf41004f0'
[10/14/16 06:35:58] [DEBUG] fetched MySQL result '0xf4100768'
[10/14/16 06:35:58] [DEBUG] allocated 20 bytes for PAWN result
[10/14/16 06:35:58] [DEBUG] CCallback::Execute(amx=0x9ac4d38, index=32, num_params=1)
[10/14/16 06:35:58] [INFO] Executing callback 'OnUserCheck' with 1 parameter...
[10/14/16 06:35:58] [DEBUG] processing internal specifier 'c'
[10/14/16 06:35:58] [DEBUG] pushed value '0' onto AMX stack
[10/14/16 06:35:58] [DEBUG] executing AMX callback with index '32'
[10/14/16 06:35:58] [DEBUG] cache_get_row_count(0xF5488934) (Nitradoscript.p:296)
[10/14/16 06:35:58] [DEBUG] cache_get_row_count: return value: '1' (Nitradoscript.p:296)
[10/14/16 06:35:58] [DEBUG] AMX callback executed with error '0'
[10/14/16 06:35:58] [INFO] Callback successfully executed.
[10/14/16 06:35:59] [DEBUG] mysql_format(1, 0xF5488528, 256, "SELECT * FROM Accounts WHERE Name = '%s' AND password = MD5('%s')") (Nitradoscript.p:1069)
[10/14/16 06:35:59] [DEBUG] mysql_format: return value: '74' (Nitradoscript.p:1069)
[10/14/16 06:35:59] [DEBUG] mysql_pquery(1, "SELECT * FROM Accounts WHERE Name = 'Tiriago' AND password = MD5('jaguar')", "OnUserLogin", "d") (Nitradoscript.p:1071)
[10/14/16 06:35:59] [DEBUG] CCallback::Create(amx=0x9ac4d38, name='OnUserLogin', format='d', params=0xf5488510, param_offset=5)
[10/14/16 06:35:59] [DEBUG] CCallback::Create - callback index for 'OnUserLogin': 33
[10/14/16 06:35:59] [DEBUG] processing specifier 'd' with parameter index 0
[10/14/16 06:35:59] [DEBUG] retrieved and pushed value '0'
[10/14/16 06:35:59] [INFO] Callback 'OnUserLogin' set up for delayed execution.
[10/14/16 06:35:59] [DEBUG] created delayed callback with 1 parameter
[10/14/16 06:35:59] [DEBUG] CHandle::Execute(this=0x9953ab0, type=2, query=0x9b143e8)
[10/14/16 06:35:59] [DEBUG] CConnectionPool::Queue(query=0x9b143e8, this=0x9a4b490)
[10/14/16 06:35:59] [DEBUG] CHandle::Execute - return value: true
[10/14/16 06:35:59] [DEBUG] mysql_pquery: return value: '1' (Nitradoscript.p:1071)
[10/14/16 06:35:59] [DEBUG] CConnection::Execute(query=0x9b143e8, this=0xf42db008, connection=0x9af2150)
[10/14/16 06:35:59] [DEBUG] CQuery::Execute(this=0x9b143e8, connection=0x9af2150)
[10/14/16 06:35:59] [INFO] query "SELECT * FROM Accounts WHERE Name = 'Tiriago' AND password = MD5('jaguar')" successfully executed within 1.271 milliseconds
[10/14/16 06:35:59] [DEBUG] CResultSet::Create(connection=0x9af2150, query_str='SELECT * FROM Accounts WHERE Name = 'Tiriago' AND password = MD5('jaguar')')
[10/14/16 06:35:59] [DEBUG] created new resultset '0xf37004f0'
[10/14/16 06:35:59] [DEBUG] fetched MySQL result '0xf37007a8'
[10/14/16 06:35:59] [DEBUG] allocated 100 bytes for PAWN result
[10/14/16 06:35:59] [DEBUG] CCallback::Execute(amx=0x9ac4d38, index=33, num_params=1)
[10/14/16 06:35:59] [INFO] Executing callback 'OnUserLogin' with 1 parameter...
[10/14/16 06:35:59] [DEBUG] processing internal specifier 'c'
[10/14/16 06:35:59] [DEBUG] pushed value '0' onto AMX stack
[10/14/16 06:35:59] [DEBUG] executing AMX callback with index '33'
[10/14/16 06:35:59] [DEBUG] cache_get_row_count(0xF5488934) (Nitradoscript.p:1121)
[10/14/16 06:35:59] [DEBUG] cache_get_row_count: return value: '1' (Nitradoscript.p:1121)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int(0, "id", 0xF54735B4) (Nitradoscript.p:1131)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int: assigned value: '1' (Nitradoscript.p:1131)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1131)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int(0, "Adminlevel", 0xF547361C) (Nitradoscript.p:1132)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int: assigned value: '7' (Nitradoscript.p:1132)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1132)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int(0, "Level", 0xF5473620) (Nitradoscript.p:1133)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int: assigned value: '2' (Nitradoscript.p:1133)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1133)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int(0, "Money", 0xF5473624) (Nitradoscript.p:1134)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int: assigned value: '0' (Nitradoscript.p:1134)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1134)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int(0, "Fraktion", 0xF5473628) (Nitradoscript.p:1135)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int: assigned value: '0' (Nitradoscript.p:1135)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1135)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int(0, "Rang", 0xF547362C) (Nitradoscript.p:1136)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int: assigned value: '0' (Nitradoscript.p:1136)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1136)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int(0, "Spawn", 0xF5473630) (Nitradoscript.p:1137)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int: assigned value: '0' (Nitradoscript.p:1137)
[10/14/16 06:35:59] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1137)
[10/14/16 06:35:59] [DEBUG] AMX callback executed with error '0'
[10/14/16 06:35:59] [INFO] Callback successfully executed.
[10/14/16 06:38:48] [DEBUG] mysql_pquery(1, "INSERT INTO autos(besitzer,model,x,y,z,r) VALUES('1','411','1705.761108','-2313.811279','13.546875','263.543304')", "carSavedToDB", "i") (Nitradoscript.p:879)
[10/14/16 06:38:48] [DEBUG] CCallback::Create(amx=0x9ac4d38, name='carSavedToDB', format='i', params=0xf5488418, param_offset=5)
[10/14/16 06:38:48] [DEBUG] CCallback::Create - callback index for 'carSavedToDB': -10057
[10/14/16 06:38:48] [DEBUG] processing specifier 'i' with parameter index 0
[10/14/16 06:38:48] [DEBUG] retrieved and pushed value '0'
[10/14/16 06:38:48] [INFO] Callback 'carSavedToDB' set up for delayed execution.
[10/14/16 06:38:48] [DEBUG] created delayed callback with 1 parameter
[10/14/16 06:38:48] [DEBUG] CHandle::Execute(this=0x9953ab0, type=2, query=0x997d380)
[10/14/16 06:38:48] [DEBUG] CConnectionPool::Queue(query=0x997d380, this=0x9a4b490)
[10/14/16 06:38:48] [DEBUG] CHandle::Execute - return value: true
[10/14/16 06:38:48] [DEBUG] mysql_pquery: return value: '1' (Nitradoscript.p:879)
[10/14/16 06:38:48] [DEBUG] CConnection::Execute(query=0x997d380, this=0xf4b5d008, connection=0x9aebb00)
[10/14/16 06:38:48] [DEBUG] CQuery::Execute(this=0x997d380, connection=0x9aebb00)
[10/14/16 06:38:48] [INFO] query "INSERT INTO autos(besitzer,model,x,y,z,r) VALUES('1','411','1705.761108','-2313.811279','13.546875','263.543304')" successfully executed within 2.723 milliseconds
[10/14/16 06:38:48] [DEBUG] CResultSet::Create(connection=0x9aebb00, query_str='INSERT INTO autos(besitzer,model,x,y,z,r) VALUES('1','411','1705.761108','-2313.811279','13.546875','263.543304')')
[10/14/16 06:38:48] [DEBUG] created new resultset '0xf4100800'
[10/14/16 06:38:48] [DEBUG] fetched MySQL result '0x0'
[10/14/16 06:38:48] [DEBUG] CCallback::Execute(amx=0x9ac4d38, index=-10057, num_params=1)
[10/14/16 06:38:48] [INFO] Executing callback '��' with 1 parameter...
[10/14/16 06:38:48] [DEBUG] processing internal specifier 'c'
[10/14/16 06:38:48] [DEBUG] pushed value '0' onto AMX stack
[10/14/16 06:38:48] [DEBUG] executing AMX callback with index '-10057'
[10/14/16 06:38:48] [DEBUG] AMX callback executed with error '0'
[10/14/16 06:38:48] [INFO] Callback successfully executed.
[10/14/16 06:40:20] [DEBUG] mysql_format(1, 0xF5488734, 128, "SELECT id FROM Accounts WHERE Name = '%e'") (Nitradoscript.p:270)
[10/14/16 06:40:20] [DEBUG] CHandle::EscapeString(this=0x9953ab0, src='Tiriago')
[10/14/16 06:40:20] [DEBUG] CConnection::EscapeString(src='Tiriago', this=0x9a446d0, connection=0x9ac5178)
[10/14/16 06:40:20] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'Tiriago'
[10/14/16 06:40:20] [DEBUG] mysql_format: return value: '46' (Nitradoscript.p:270)
[10/14/16 06:40:20] [DEBUG] mysql_pquery(1, "SELECT id FROM Accounts WHERE Name = 'Tiriago'", "OnUserCheck", "d") (Nitradoscript.p:271)
[10/14/16 06:40:20] [DEBUG] CCallback::Create(amx=0x9ac4d38, name='OnUserCheck', format='d', params=0xf548871c, param_offset=5)
[10/14/16 06:40:20] [DEBUG] CCallback::Create - callback index for 'OnUserCheck': 32
[10/14/16 06:40:20] [DEBUG] processing specifier 'd' with parameter index 0
[10/14/16 06:40:20] [DEBUG] retrieved and pushed value '0'
[10/14/16 06:40:20] [INFO] Callback 'OnUserCheck' set up for delayed execution.
[10/14/16 06:40:20] [DEBUG] created delayed callback with 1 parameter
[10/14/16 06:40:20] [DEBUG] CHandle::Execute(this=0x9953ab0, type=2, query=0x9b13e88)
[10/14/16 06:40:20] [DEBUG] CConnectionPool::Queue(query=0x9b13e88, this=0x9a4b490)
[10/14/16 06:40:20] [DEBUG] CHandle::Execute - return value: true
[10/14/16 06:40:20] [DEBUG] mysql_pquery: return value: '1' (Nitradoscript.p:271)
[10/14/16 06:40:20] [DEBUG] CConnection::Execute(query=0x9b13e88, this=0xf42db008, connection=0x9af2150)
[10/14/16 06:40:20] [DEBUG] CQuery::Execute(this=0x9b13e88, connection=0x9af2150)
[10/14/16 06:40:20] [INFO] query "SELECT id FROM Accounts WHERE Name = 'Tiriago'" successfully executed within 0.274 milliseconds
[10/14/16 06:40:20] [DEBUG] CResultSet::Create(connection=0x9af2150, query_str='SELECT id FROM Accounts WHERE Name = 'Tiriago'')
[10/14/16 06:40:20] [DEBUG] created new resultset '0xf3700938'
[10/14/16 06:40:20] [DEBUG] fetched MySQL result '0xf3700838'
[10/14/16 06:40:20] [DEBUG] allocated 20 bytes for PAWN result
[10/14/16 06:40:20] [DEBUG] CCallback::Execute(amx=0x9ac4d38, index=32, num_params=1)
[10/14/16 06:40:20] [INFO] Executing callback 'OnUserCheck' with 1 parameter...
[10/14/16 06:40:20] [DEBUG] processing internal specifier 'c'
[10/14/16 06:40:20] [DEBUG] pushed value '0' onto AMX stack
[10/14/16 06:40:20] [DEBUG] executing AMX callback with index '32'
[10/14/16 06:40:20] [DEBUG] cache_get_row_count(0xF5488934) (Nitradoscript.p:296)
[10/14/16 06:40:20] [DEBUG] cache_get_row_count: return value: '1' (Nitradoscript.p:296)
[10/14/16 06:40:20] [DEBUG] AMX callback executed with error '0'
[10/14/16 06:40:20] [INFO] Callback successfully executed.
[10/14/16 06:40:22] [DEBUG] mysql_format(1, 0xF5488528, 256, "SELECT * FROM Accounts WHERE Name = '%s' AND password = MD5('%s')") (Nitradoscript.p:1069)
[10/14/16 06:40:22] [DEBUG] mysql_format: return value: '74' (Nitradoscript.p:1069)
[10/14/16 06:40:22] [DEBUG] mysql_pquery(1, "SELECT * FROM Accounts WHERE Name = 'Tiriago' AND password = MD5('jaguar')", "OnUserLogin", "d") (Nitradoscript.p:1071)
[10/14/16 06:40:22] [DEBUG] CCallback::Create(amx=0x9ac4d38, name='OnUserLogin', format='d', params=0xf5488510, param_offset=5)
[10/14/16 06:40:22] [DEBUG] CCallback::Create - callback index for 'OnUserLogin': 33
[10/14/16 06:40:22] [DEBUG] processing specifier 'd' with parameter index 0
[10/14/16 06:40:22] [DEBUG] retrieved and pushed value '0'
[10/14/16 06:40:22] [INFO] Callback 'OnUserLogin' set up for delayed execution.
[10/14/16 06:40:22] [DEBUG] created delayed callback with 1 parameter
[10/14/16 06:40:22] [DEBUG] CHandle::Execute(this=0x9953ab0, type=2, query=0x994bce0)
[10/14/16 06:40:22] [DEBUG] CConnectionPool::Queue(query=0x994bce0, this=0x9a4b490)
[10/14/16 06:40:22] [DEBUG] CHandle::Execute - return value: true
[10/14/16 06:40:22] [DEBUG] mysql_pquery: return value: '1' (Nitradoscript.p:1071)
[10/14/16 06:40:22] [DEBUG] CConnection::Execute(query=0x994bce0, this=0xf4b5d008, connection=0x9aebb00)
[10/14/16 06:40:22] [DEBUG] CQuery::Execute(this=0x994bce0, connection=0x9aebb00)
[10/14/16 06:40:22] [INFO] query "SELECT * FROM Accounts WHERE Name = 'Tiriago' AND password = MD5('jaguar')" successfully executed within 0.330 milliseconds
[10/14/16 06:40:22] [DEBUG] CResultSet::Create(connection=0x9aebb00, query_str='SELECT * FROM Accounts WHERE Name = 'Tiriago' AND password = MD5('jaguar')')
[10/14/16 06:40:22] [DEBUG] created new resultset '0xf41004f0'
[10/14/16 06:40:22] [DEBUG] fetched MySQL result '0xf41007a8'
[10/14/16 06:40:22] [DEBUG] allocated 100 bytes for PAWN result
[10/14/16 06:40:22] [DEBUG] CCallback::Execute(amx=0x9ac4d38, index=33, num_params=1)
[10/14/16 06:40:22] [INFO] Executing callback 'OnUserLogin' with 1 parameter...
[10/14/16 06:40:22] [DEBUG] processing internal specifier 'c'
[10/14/16 06:40:22] [DEBUG] pushed value '0' onto AMX stack
[10/14/16 06:40:22] [DEBUG] executing AMX callback with index '33'
[10/14/16 06:40:22] [DEBUG] cache_get_row_count(0xF5488934) (Nitradoscript.p:1121)
[10/14/16 06:40:22] [DEBUG] cache_get_row_count: return value: '1' (Nitradoscript.p:1121)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int(0, "id", 0xF54735B4) (Nitradoscript.p:1131)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int: assigned value: '1' (Nitradoscript.p:1131)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1131)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int(0, "Adminlevel", 0xF547361C) (Nitradoscript.p:1132)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int: assigned value: '7' (Nitradoscript.p:1132)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1132)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int(0, "Level", 0xF5473620) (Nitradoscript.p:1133)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int: assigned value: '2' (Nitradoscript.p:1133)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1133)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int(0, "Money", 0xF5473624) (Nitradoscript.p:1134)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int: assigned value: '0' (Nitradoscript.p:1134)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1134)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int(0, "Fraktion", 0xF5473628) (Nitradoscript.p:1135)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int: assigned value: '0' (Nitradoscript.p:1135)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1135)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int(0, "Rang", 0xF547362C) (Nitradoscript.p:1136)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int: assigned value: '0' (Nitradoscript.p:1136)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1136)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int(0, "Spawn", 0xF5473630) (Nitradoscript.p:1137)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int: assigned value: '0' (Nitradoscript.p:1137)
[10/14/16 06:40:22] [DEBUG] cache_get_value_name_int: return value: '1' (Nitradoscript.p:1137)
[10/14/16 06:40:22] [DEBUG] AMX callback executed with error '0'
[10/14/16 06:40:22] [INFO] Callback successfully executed.
Alles anzeigen
Pawn Code für das Fraktionssystem:
Enum:
Code
enum playerInfo{
db_id,
bool:eingeloggt,
Name[MAX_PLAYER_NAME],
Adminlevel,
Level,
Money,
Fraktion,
Rang,
Spawn
}
new sInfo[MAX_PLAYER_NAME][playerInfo];
enum frakteEnum{
f_name[300],
Float:f_x,
Float:f_y,
Float:f_z,
Float:f_r,
f_inter,
f_world,
f_color
}
new fInfo[][frakteEnum] ={
{"Zivilist",329.0244,-1513.3033,36.0391,225.8344,0,0,weiß},//Zivilist 0
{"SAPD",213.4162,162.7460,1003.0234,274.4569,3,1,blau},//SAPD 1
{"SWAT",2731.5903,-2450.0164,17.5937,272.4424,0,0,helblau},//SWAT2
{"FBI",2286.9651,2431.6011,10.8203,176.4887,0,0,duneklhelblau},//FBI3
{"ARMY",214.2768,1822.5925,6.4141,265.0869,0,0,hellgrün},//ARMY4
{"Medic/Feuerwehr",302.9467,-1505.8025,24.6007,231.6743,0,0,rot},//MEDIC5
{"Fahrschule",2124.3032,-2273.0491,20.6719,221.7338,0,0,orange},//Fahrschule6
{"Aztecas",2788.4141,-1944.7075,13.5469,87.2128,0,0,türkis},//AZTECAS7
{"Vagos",204.6566,39.7421,2.5781,260.2514,0,0,gelb},//Vagos8
{"Ballas",1084.8976,-1226.7927,15.8203,269.7700,0,0,pink},//Ballas9
{"Yakuza",-2188.6282,-2265.0452,30.6250,71.4091,0,0,grau}//Yakuza10
};
Alles anzeigen
Spieler verbindet sich mit dem Server:
Code
public OnPlayerConnect(playerid)
{
sInfo[playerid][db_id] =0;
sInfo[playerid][eingeloggt] =false;
sInfo[playerid][Adminlevel] =0;
sInfo[playerid][Level] = 0;
sInfo[playerid][Money] = 0;
sInfo[playerid][Fraktion] = 0;
sInfo[playerid][Rang] = 0;
sInfo[playerid][Spawn] = 0;
GetPlayerName(playerid,sInfo[playerid][Name],MAX_PLAYER_NAME);
SetPlayerColor(playerid,weiß);
sInfo[playerid][Level]=1;
SetPlayerScore(playerid,sInfo[playerid][Level]);
return 1;
}
Alles anzeigen
Spieler Speicher/Resten:
Code
resetPlayer(playerid)
{
for(new i=0; i<sizeof(sInfo[]); i++)
{
sInfo[playerid][playerInfo:i]=0;
}
return 1;
}
stock SaveUserStats(playerid)
{
//Wen der Spieler nicht eingeloggt ist, dann speichere seine Statistiken nicht
if(!sInfo[playerid][eingeloggt])return 1;
//Ansonsten speichere Sie ab
new query[600];
mysql_format(handle,query,sizeof(query),"UPDATE Accounts Set Name = '%s',Adminlevel = '%d',Level = '%d',Money = '%d',Fraktion = '%i',Rang = '%d',Spawn = '%d' WHERE id = '%d' ",sInfo[playerid][Adminlevel],sInfo[playerid][Level],sInfo[playerid][Money],sInfo[playerid][Fraktion],sInfo[playerid][Rang],sInfo[playerid][Spawn],sInfo[playerid][db_id]);
//Das Query wird abgesendet
mysql_pquery(handle,query);
return 1;
}
Alles anzeigen
Spieler geht vom Server:
Code
public OnPlayerDisconnect(playerid, reason)
{
SaveUserStats(playerid);
resetPlayer(playerid);
return 1;
}
SpielerSpawnt:
Code
public OnPlayerSpawn(playerid)
{
if(!isPlayerInFrakt(playerid,0))
{
if(sInfo[playerid][Spawn]==1)
{
new fID;
fID= sInfo[playerid][Fraktion];
SetPlayerPos(playerid,fInfo[fID][f_x],fInfo[fID][f_y],fInfo[fID][f_z]);
SetPlayerFacingAngle(playerid,fInfo[fID][f_r]);
SetPlayerInterior(playerid,fInfo[fID][f_inter]);
SetPlayerVirtualWorld(playerid,fInfo[fID][f_world]);
SetPlayerColor(playerid,fInfo[fID][f_color]);
}
}
SendClientMessage(playerid,rot,"/hilfe um die Befehle zu sehen!");
return 1;
}
Alles anzeigen
Fraktionsabfrage:
Leadererstellen:
Code
ocmd:leadererstellen(playerid,params[])
{
if(!isAdmin(playerid,5))return SendClientMessage(playerid,grün,"Du hast keine Berechtigung dazu!");
new pID, fID;
if(sscanf(params,"ui",pID,fID))return SendClientMessage(playerid,rot,"INFO: /Leadererstellen[playerid][fraktid]");
if(fID>= sizeof(fInfo))return SendClientMessage(playerid,rot,"Fraktion existiert nicht.");
sInfo[pID][Fraktion] = fID;
sInfo[pID][Rang] = 6;
new string[128];
format(string,sizeof(string),"%s hat dich zum Leader der Fraktion %s gemacht",getPlayerName(playerid),fInfo[fID][f_name]);
SendClientMessage(pID,gelb,string);
SendClientMessage(playerid,grün,"Du hast einen Spieler zum Leader gemacht.");
return 1;
}
Alles anzeigen
OnUserLogin:
Code
public OnUserLogin(playerid)
{
new rows;
cache_get_row_count(rows);
if(rows == 0)
{
//Der Spieler hat ein falsches Passwort eingegeben
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Einloggen","Bitte logge dich ein:\n{0xFF0000FF}Falsches Passwort!","Einloggen","Abbrechen");
}
else
{
//Es existiert ein Ergebnis,das heißt der Spieler hat das richtige Passwort eingegeben
//Wir lesen nun die erste Zeile des Caches aus (id 0)
cache_get_value_name_int(0,"id",sInfo[playerid][db_id]);
cache_get_value_name_int(0,"Adminlevel",sInfo[playerid][Adminlevel]);
cache_get_value_name_int(0,"Level",sInfo[playerid][Level]);
cache_get_value_name_int(0,"Money",sInfo[playerid][Money]);
cache_get_value_name_int(0,"Fraktion",sInfo[playerid][Fraktion]);
cache_get_value_name_int(0,"Rang",sInfo[playerid][Rang]);
cache_get_value_name_int(0,"Spawn",sInfo[playerid][Spawn]);
}
return 1;
}
Alles anzeigen