Hi!
Irgendwie habe ich das Problem, dass mein Server, nachdem ich connecte abstürzt?
Ich bekomme noch eine MsgBox mit dem Inhalt "Willst du das Tutorial anschauen?" und dann stürzt er ab.
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <ocmd>
#include <a_mysql>
#include <AC>
#include <ocmd>
#include <a_mysql>
#include <AC>
// Farben
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_BLUE 0x0000FFFF
#define COLOR_RED 0xFF0000FF
#define COLOR_BLACK 0x000000FF
#define COLOR_GREEN 0x00FF00FF
#define COLOR_YELLOW 0xFFFF00FF
#define COLOR_PURPLE 0xFF00FFFF
#define COLOR_TÜRKIS 0x00FFFFFF
#define COLOR_LIGHTRED 0xFF444BFF
#define COLOR_LIGHTBLUE 0x738EFFFF
#define COLOR_GREY 0xA8A8A8FF
#define COLOR_BLUE 0x0000FFFF
#define COLOR_RED 0xFF0000FF
#define COLOR_BLACK 0x000000FF
#define COLOR_GREEN 0x00FF00FF
#define COLOR_YELLOW 0xFFFF00FF
#define COLOR_PURPLE 0xFF00FFFF
#define COLOR_TÜRKIS 0x00FFFFFF
#define COLOR_LIGHTRED 0xFF444BFF
#define COLOR_LIGHTBLUE 0x738EFFFF
#define COLOR_GREY 0xA8A8A8FF
// Dialoge
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_TUTORIAL_REQUEST 3
#define DIALOG_LOGIN 2
#define DIALOG_TUTORIAL_REQUEST 3
// Motor system
new engine, light, alarm, door, bonnet, boot, objective;
// forwards
forward OnPasswordResponse(playerid);
forward UserLoad(playerid);
forward UserCheck(playerid);
forward UserLoad(playerid);
forward UserCheck(playerid);
// Auto Array
new lspd[26];
// mysql
new dbhandle;
#define db_user "Samp38703_40"
#define db_db "Samp38703_40"
#define db_host "127.0.0.1"
#define db_pass "nanana"
#define db_db "Samp38703_40"
#define db_host "127.0.0.1"
#define db_pass "nanana"
forward Spawn(playerid);
main()
{
print("==============================\n\n");
print(" Whitelife Roleplay by [WRP] Team");
print("\n\n==============================");
}
{
print("==============================\n\n");
print(" Whitelife Roleplay by [WRP] Team");
print("\n\n==============================");
}
public OnGameModeInit()
{
ManualVehicleEngineAndLights();
DisableInteriorEnterExits();
EnableStuntBonusForAll(0);
LimitGlobalChatRadius(0);
// MySQL
dbhandle = mysql_connect(db_host, db_user, db_db, db_pass);
// General
SetGameModeText("-|- WRP -|-");
// NPC's
ConnectNPC("Wachmeister", "Wachmeisterrec");
{
ManualVehicleEngineAndLights();
DisableInteriorEnterExits();
EnableStuntBonusForAll(0);
LimitGlobalChatRadius(0);
// MySQL
dbhandle = mysql_connect(db_host, db_user, db_db, db_pass);
// General
SetGameModeText("-|- WRP -|-");
// NPC's
ConnectNPC("Wachmeister", "Wachmeisterrec");
// AUTOS
for(new i = 0; i < MAX_VEHICLES; i++) {
SetVehicleParamsEx(i, 0,0,0,0,0,0,0);
}
SetVehicleParamsEx(i, 0,0,0,0,0,0,0);
}
// LSPD
lspd[0] = AddStaticVehicle(596,1526.6300,-1644.3278,5.6107,179.7765,0,1); // LSPD Car 1
lspd[1] = AddStaticVehicle(596,1530.4698,-1644.2784,5.6120,180.3946,0,1); // LSPD Car 2
lspd[2] = AddStaticVehicle(596,1534.6206,-1644.3658,5.6110,179.2508,0,1); // LSPD Car 3
lspd[3] = AddStaticVehicle(596,1538.5398,-1644.3282,5.6110,179.2715,0,1); // LSPD Car 4
lspd[4] = AddStaticVehicle(596,1546.2047,-1651.1661,5.6115,90.1116,0,1); // LSPD Car 5
lspd[5] = AddStaticVehicle(596,1546.2781,-1655.1328,5.6117,90.1414,0,1); // LSPD Car 6
lspd[6] = AddStaticVehicle(596,1546.2439,-1659.0764,5.6110,90.2168,0,1); // LSPD Car 7
lspd[7] = AddStaticVehicle(596,1546.2296,-1663.1793,5.6120,90.3687,0,1); // LSPD Car 8
lspd[8] = AddStaticVehicle(560,1546.6859,-1668.0930,5.5959,90.7746,9,39); // LSPD Sultan 1
lspd[9] = AddStaticVehicle(560,1546.5592,-1672.0665,5.5956,90.1916,17,1); // LSPD Sultan 2
lspd[10] = AddStaticVehicle(560,1546.4419,-1676.1392,5.5956,88.7348,21,1); // LSPD Sultan 3
lspd[11] = AddStaticVehicle(560,1546.3993,-1680.1637,5.5958,90.2896,33,0); // LSPD Sultan 4
lspd[12] = AddStaticVehicle(560,1546.4392,-1684.4308,5.5955,89.4650,37,0); // LSPD Sultan 5
lspd[13] = AddStaticVehicle(427,1529.1765,-1683.8743,6.0225,269.6161,0,1); // Enforcer 1
lspd[14] = AddStaticVehicle(427,1530.1246,-1687.8660,6.0256,269.3059,0,1); // Enforcer 2
lspd[15] = AddStaticVehicle(599,1595.5616,-1710.1450,6.0784,359.4775,0,1); // LSPD Rancher 1
lspd[16] = AddStaticVehicle(599,1591.6626,-1710.1747,6.0794,0.3244,0,1); // LSPD Rancher 2
lspd[17] = AddStaticVehicle(599,1587.4861,-1710.2266,6.0797,0.7495,0,1); // LSPD Rancher 3
lspd[18] = AddStaticVehicle(599,1583.3147,-1710.2830,6.0775,359.6796,0,1); // LSPD Rancher 4
lspd[19] = AddStaticVehicle(523,1601.7091,-1704.1667,5.4585,92.9089,0,0); // LSPD HPV 1
lspd[20] = AddStaticVehicle(523,1601.6749,-1700.3553,5.4613,89.0891,0,0); // LSPD HPV 2
lspd[21] = AddStaticVehicle(523,1601.4131,-1696.4059,5.4611,89.1514,0,0); // LSPD HPV 3
lspd[22] = AddStaticVehicle(523,1601.0735,-1692.1339,5.4611,89.1552,0,0); // LSPD HPV 4
lspd[23] = AddStaticVehicle(523,1601.0410,-1688.2804,5.4607,87.1093,0,0); // LSPD HPV 5
lspd[24] = AddStaticVehicle(523,1600.9911,-1684.0820,5.4606,87.0556,0,0); // LSPD HPV 6
lspd[25] = AddStaticVehicle(470,1558.7642,-1710.4139,5.8806,359.6555,43,0); // LSPD Patriot
lspd[1] = AddStaticVehicle(596,1530.4698,-1644.2784,5.6120,180.3946,0,1); // LSPD Car 2
lspd[2] = AddStaticVehicle(596,1534.6206,-1644.3658,5.6110,179.2508,0,1); // LSPD Car 3
lspd[3] = AddStaticVehicle(596,1538.5398,-1644.3282,5.6110,179.2715,0,1); // LSPD Car 4
lspd[4] = AddStaticVehicle(596,1546.2047,-1651.1661,5.6115,90.1116,0,1); // LSPD Car 5
lspd[5] = AddStaticVehicle(596,1546.2781,-1655.1328,5.6117,90.1414,0,1); // LSPD Car 6
lspd[6] = AddStaticVehicle(596,1546.2439,-1659.0764,5.6110,90.2168,0,1); // LSPD Car 7
lspd[7] = AddStaticVehicle(596,1546.2296,-1663.1793,5.6120,90.3687,0,1); // LSPD Car 8
lspd[8] = AddStaticVehicle(560,1546.6859,-1668.0930,5.5959,90.7746,9,39); // LSPD Sultan 1
lspd[9] = AddStaticVehicle(560,1546.5592,-1672.0665,5.5956,90.1916,17,1); // LSPD Sultan 2
lspd[10] = AddStaticVehicle(560,1546.4419,-1676.1392,5.5956,88.7348,21,1); // LSPD Sultan 3
lspd[11] = AddStaticVehicle(560,1546.3993,-1680.1637,5.5958,90.2896,33,0); // LSPD Sultan 4
lspd[12] = AddStaticVehicle(560,1546.4392,-1684.4308,5.5955,89.4650,37,0); // LSPD Sultan 5
lspd[13] = AddStaticVehicle(427,1529.1765,-1683.8743,6.0225,269.6161,0,1); // Enforcer 1
lspd[14] = AddStaticVehicle(427,1530.1246,-1687.8660,6.0256,269.3059,0,1); // Enforcer 2
lspd[15] = AddStaticVehicle(599,1595.5616,-1710.1450,6.0784,359.4775,0,1); // LSPD Rancher 1
lspd[16] = AddStaticVehicle(599,1591.6626,-1710.1747,6.0794,0.3244,0,1); // LSPD Rancher 2
lspd[17] = AddStaticVehicle(599,1587.4861,-1710.2266,6.0797,0.7495,0,1); // LSPD Rancher 3
lspd[18] = AddStaticVehicle(599,1583.3147,-1710.2830,6.0775,359.6796,0,1); // LSPD Rancher 4
lspd[19] = AddStaticVehicle(523,1601.7091,-1704.1667,5.4585,92.9089,0,0); // LSPD HPV 1
lspd[20] = AddStaticVehicle(523,1601.6749,-1700.3553,5.4613,89.0891,0,0); // LSPD HPV 2
lspd[21] = AddStaticVehicle(523,1601.4131,-1696.4059,5.4611,89.1514,0,0); // LSPD HPV 3
lspd[22] = AddStaticVehicle(523,1601.0735,-1692.1339,5.4611,89.1552,0,0); // LSPD HPV 4
lspd[23] = AddStaticVehicle(523,1601.0410,-1688.2804,5.4607,87.1093,0,0); // LSPD HPV 5
lspd[24] = AddStaticVehicle(523,1600.9911,-1684.0820,5.4606,87.0556,0,0); // LSPD HPV 6
lspd[25] = AddStaticVehicle(470,1558.7642,-1710.4139,5.8806,359.6555,43,0); // LSPD Patriot
return 1;
}
}
public OnGameModeExit()
{
mysql_close(dbhandle);
return 1;
}
{
mysql_close(dbhandle);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
if(IsPlayerNPC(playerid)) return 1;
if(GetPVarInt(playerid, "Fraktion") == 0) {
AddPlayerClass(1, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(2, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(3, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(4, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(5, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(6, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(7, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(9, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(10, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(11, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(12, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(13, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(14, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(15, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(17, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(18, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(19, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(20, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(21, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(22, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(23, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(24, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(25, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(26, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(28, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(29, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(30, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(31, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(32, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
}
SetPlayerPos(playerid, 2962.2549,-1877.4528,8.7813);
SetPlayerFacingAngle(playerid, 84.3998);
SetPlayerCameraPos(playerid, 2959.7366,-1877.5195,10.7813);
SetPlayerCameraLookAt(playerid, 2962.2549,-1877.4528,8.7813);
return 1;
}
{
if(IsPlayerNPC(playerid)) return 1;
if(GetPVarInt(playerid, "Fraktion") == 0) {
AddPlayerClass(1, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(2, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(3, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(4, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(5, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(6, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(7, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(9, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(10, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(11, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(12, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(13, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(14, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(15, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(17, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(18, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(19, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(20, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(21, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(22, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(23, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(24, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(25, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(26, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(28, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(29, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(30, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(31, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
AddPlayerClass(32, 1022.4252,-1121.8209,23.8717,190.1917, 0, 0, 0, 0, 0, 0);
}
SetPlayerPos(playerid, 2962.2549,-1877.4528,8.7813);
SetPlayerFacingAngle(playerid, 84.3998);
SetPlayerCameraPos(playerid, 2959.7366,-1877.5195,10.7813);
SetPlayerCameraLookAt(playerid, 2962.2549,-1877.4528,8.7813);
return 1;
}
public OnPlayerConnect(playerid)
{
new n[MAX_PLAYER_NAME];
GetPlayerName(playerid, n, sizeof(n));
if(IsPlayerNPC(playerid)){
if(!strcmp("Wachmeister", n, true, 10)) {
SetPlayerSkin(playerid, 283);
return 1;
}
} else {
new query[128];
format(query, sizeof(query), "SELECT id FROM users WHERE Name='%s'", n);
mysql_function_query(dbhandle, query, true, "UserCheck", "i", playerid);
}
return 1;
}
{
new n[MAX_PLAYER_NAME];
GetPlayerName(playerid, n, sizeof(n));
if(IsPlayerNPC(playerid)){
if(!strcmp("Wachmeister", n, true, 10)) {
SetPlayerSkin(playerid, 283);
return 1;
}
} else {
new query[128];
format(query, sizeof(query), "SELECT id FROM users WHERE Name='%s'", n);
mysql_function_query(dbhandle, query, true, "UserCheck", "i", playerid);
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(IsPlayerNPC(playerid)) return 1;
return 1;
}
{
if(IsPlayerNPC(playerid)) return 1;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(GetPVarInt(playerid, "Fraktion") == 0) {
SetPlayerPos(playerid, 1022.4252,-1121.8209,23.8717);
SetPlayerFacingAngle(playerid,190.1917);
return 1;
}
return 1;
}
{
if(GetPVarInt(playerid, "Fraktion") == 0) {
SetPlayerPos(playerid, 1022.4252,-1121.8209,23.8717);
SetPlayerFacingAngle(playerid,190.1917);
return 1;
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/motor", cmdtext, true, 10)) {
if(!IsInCar(playerid) && !IsInPlane(playerid) && !IsInBike(playerid) && !IsInBoat(playerid)) return SendClientMessage(playerid, COLOR_RED, "Du bist in keinem Fahrzeug");
if(IsInCar(playerid)){
if(GetPVarInt(playerid, "AutoLic") != 1 && GetPVarInt(playerid, "Aduty") != 1) return SendClientMessage(playerid, COLOR_RED, "Du hast keinen Führerschein");
new car = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(car, engine, light, alarm, door, bonnet, boot, objective);
if(engine == 1) {
SetVehicleParamsEx(car, 0, light, alarm , door, bonnet, boot, objective);
} else {
SetVehicleParamsEx(car, 1, light, alarm, door, bonnet, boot, objective);
}
}
if(IsInBike(playerid)){
if(GetPVarInt(playerid, "BikeLic") != 1 && GetPVarInt(playerid, "Aduty") != 1) return SendClientMessage(playerid, COLOR_RED, "Du hast keinen Führerschein");
new car = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(car, engine, light, alarm, door, bonnet, boot, objective);
if(engine == 1) {
SetVehicleParamsEx(car, 0, light, alarm , door, bonnet, boot, objective);
} else {
SetVehicleParamsEx(car, 1, light, alarm, door, bonnet, boot, objective);
}
}
if(IsInPlane(playerid)){
if(GetPVarInt(playerid, "FlyLic") != 1 && GetPVarInt(playerid, "Aduty") != 1) return SendClientMessage(playerid, COLOR_RED, "Du hast keinen Führerschein");
new car = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(car, engine, light, alarm, door, bonnet, boot, objective);
if(engine == 1) {
SetVehicleParamsEx(car, 0, light, alarm , door, bonnet, boot, objective);
} else {
SetVehicleParamsEx(car, 1, light, alarm, door, bonnet, boot, objective);
}
}
if(IsInBoat(playerid)){
if(GetPVarInt(playerid, "BootLic") != 1 && GetPVarInt(playerid, "Aduty") != 1) return SendClientMessage(playerid, COLOR_RED, "Du hast keinen Führerschein");
new car = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(car, engine, light, alarm, door, bonnet, boot, objective);
if(engine == 1) {
SetVehicleParamsEx(car, 0, light, alarm , door, bonnet, boot, objective);
} else {
SetVehicleParamsEx(car, 1, light, alarm, door, bonnet, boot, objective);
}
}
return 1;
}
return 0;
}
{
if(!strcmp("/motor", cmdtext, true, 10)) {
if(!IsInCar(playerid) && !IsInPlane(playerid) && !IsInBike(playerid) && !IsInBoat(playerid)) return SendClientMessage(playerid, COLOR_RED, "Du bist in keinem Fahrzeug");
if(IsInCar(playerid)){
if(GetPVarInt(playerid, "AutoLic") != 1 && GetPVarInt(playerid, "Aduty") != 1) return SendClientMessage(playerid, COLOR_RED, "Du hast keinen Führerschein");
new car = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(car, engine, light, alarm, door, bonnet, boot, objective);
if(engine == 1) {
SetVehicleParamsEx(car, 0, light, alarm , door, bonnet, boot, objective);
} else {
SetVehicleParamsEx(car, 1, light, alarm, door, bonnet, boot, objective);
}
}
if(IsInBike(playerid)){
if(GetPVarInt(playerid, "BikeLic") != 1 && GetPVarInt(playerid, "Aduty") != 1) return SendClientMessage(playerid, COLOR_RED, "Du hast keinen Führerschein");
new car = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(car, engine, light, alarm, door, bonnet, boot, objective);
if(engine == 1) {
SetVehicleParamsEx(car, 0, light, alarm , door, bonnet, boot, objective);
} else {
SetVehicleParamsEx(car, 1, light, alarm, door, bonnet, boot, objective);
}
}
if(IsInPlane(playerid)){
if(GetPVarInt(playerid, "FlyLic") != 1 && GetPVarInt(playerid, "Aduty") != 1) return SendClientMessage(playerid, COLOR_RED, "Du hast keinen Führerschein");
new car = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(car, engine, light, alarm, door, bonnet, boot, objective);
if(engine == 1) {
SetVehicleParamsEx(car, 0, light, alarm , door, bonnet, boot, objective);
} else {
SetVehicleParamsEx(car, 1, light, alarm, door, bonnet, boot, objective);
}
}
if(IsInBoat(playerid)){
if(GetPVarInt(playerid, "BootLic") != 1 && GetPVarInt(playerid, "Aduty") != 1) return SendClientMessage(playerid, COLOR_RED, "Du hast keinen Führerschein");
new car = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(car, engine, light, alarm, door, bonnet, boot, objective);
if(engine == 1) {
SetVehicleParamsEx(car, 0, light, alarm , door, bonnet, boot, objective);
} else {
SetVehicleParamsEx(car, 1, light, alarm, door, bonnet, boot, objective);
}
}
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_NO) {
{
if(newkeys & KEY_NO) {
}
return 1;
}
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==DIALOG_REGISTER)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[350],passwort[35];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>5)
{
//Registrierungsfunktion
mysql_escape_string(inputtext,passwort,dbhandle);
format(query,sizeof(query),"INSERT INTO users (Name,Passwort, Skin, Geld, Fraktion, Rang, AdminLevel, AutoLic, BikeLic, BootLic, FlyLic, WaffenLic, Level, Jailed, Jailtime, Banned, Muted, TBanTime, Tutorial) VALUES ('%s',MD5('%s'), 1, '20000', 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1)",name,passwort);
SendClientMessage(playerid, COLOR_GREEN, "Du hast dich erfolgreich registriert.");
SendClientMessage(playerid, COLOR_BLUE, "Für den weiteren Verlauf der Registrierung wirst du nun gekickt");
mysql_function_query(dbhandle,query,false,"","");
Kick(playerid);
}
else
{
//Kleiner als 4 Zeichen
SendClientMessage(playerid,COLOR_RED,"Dein Passwort muss mindestens 6 Zeichen lang sein.");
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Registrierung", "Dieser Username wurde nicht in der Datenbank gefunden.\nBitte gebe dein gewünschtes Passwort ein:", "Absenden", "Abbrechen");
}
}
else
{
Kick(playerid);
}
return 1;
}
if(dialogid==DIALOG_LOGIN)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[128],passwort[35];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>0)
{
mysql_escape_string(inputtext,passwort,dbhandle);
format(query,sizeof(query),"SELECT * FROM users WHERE Name='%s' AND Passwort=MD5('%s')",name,passwort);
mysql_function_query(dbhandle,query,true,"OnPasswordResponse","i",playerid);
}
else
{
//Keine Eingabe
SendClientMessage(playerid,COLOR_RED,"Gibt bitte dein Passwort ein.");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Dieser Username wurde in der Datenbank gefunden.\nBitte gebe das Passwort ein","Okay","Abbrechen");
}
}
else
{
Kick(playerid);
}
return 1;
}
if(dialogid == DIALOG_TUTORIAL_REQUEST) {
if(response == 0) return SpawnPlayer(playerid);
if(response == 1) {
SendClientMessage(playerid, COLOR_YELLOW, "- | - Wilkommen im Tutorial - | -");
}
}
return 1;
}
{
if(dialogid==DIALOG_REGISTER)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[350],passwort[35];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>5)
{
//Registrierungsfunktion
mysql_escape_string(inputtext,passwort,dbhandle);
format(query,sizeof(query),"INSERT INTO users (Name,Passwort, Skin, Geld, Fraktion, Rang, AdminLevel, AutoLic, BikeLic, BootLic, FlyLic, WaffenLic, Level, Jailed, Jailtime, Banned, Muted, TBanTime, Tutorial) VALUES ('%s',MD5('%s'), 1, '20000', 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1)",name,passwort);
SendClientMessage(playerid, COLOR_GREEN, "Du hast dich erfolgreich registriert.");
SendClientMessage(playerid, COLOR_BLUE, "Für den weiteren Verlauf der Registrierung wirst du nun gekickt");
mysql_function_query(dbhandle,query,false,"","");
Kick(playerid);
}
else
{
//Kleiner als 4 Zeichen
SendClientMessage(playerid,COLOR_RED,"Dein Passwort muss mindestens 6 Zeichen lang sein.");
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Registrierung", "Dieser Username wurde nicht in der Datenbank gefunden.\nBitte gebe dein gewünschtes Passwort ein:", "Absenden", "Abbrechen");
}
}
else
{
Kick(playerid);
}
return 1;
}
if(dialogid==DIALOG_LOGIN)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[128],passwort[35];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>0)
{
mysql_escape_string(inputtext,passwort,dbhandle);
format(query,sizeof(query),"SELECT * FROM users WHERE Name='%s' AND Passwort=MD5('%s')",name,passwort);
mysql_function_query(dbhandle,query,true,"OnPasswordResponse","i",playerid);
}
else
{
//Keine Eingabe
SendClientMessage(playerid,COLOR_RED,"Gibt bitte dein Passwort ein.");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Dieser Username wurde in der Datenbank gefunden.\nBitte gebe das Passwort ein","Okay","Abbrechen");
}
}
else
{
Kick(playerid);
}
return 1;
}
if(dialogid == DIALOG_TUTORIAL_REQUEST) {
if(response == 0) return SpawnPlayer(playerid);
if(response == 1) {
SendClientMessage(playerid, COLOR_YELLOW, "- | - Wilkommen im Tutorial - | -");
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
{
return 1;
}
stock sscanf(string[], format[], {Float,_}:...)
{
#if defined isnull
if (isnull(string))
#else
if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
#endif
{
return format[0];
}
#pragma tabsize 4
new
formatPos = 0,
stringPos = 0,
paramPos = 2,
paramCount = numargs(),
delim = ' ';
while (string[stringPos] && string[stringPos] <= ' ')
{
stringPos++;
}
while (paramPos < paramCount && string[stringPos])
{
switch (format[formatPos++])
{
case '\0':
{
return 0;
}
case 'i', 'd':
{
new
neg = 1,
num = 0,
ch = string[stringPos];
if (ch == '-')
{
neg = -1;
ch = string[++stringPos];
}
do
{
stringPos++;
if ('0' <= ch <= '9')
{
num = (num * 10) + (ch - '0');
}
else
{
return -1;
}
}
while ((ch = string[stringPos]) > ' ' && ch != delim);
setarg(paramPos, 0, num * neg);
}
case 'h', 'x':
{
new
num = 0,
ch = string[stringPos];
do
{
stringPos++;
switch (ch)
{
case 'x', 'X':
{
num = 0;
continue;
}
case '0' .. '9':
{
num = (num << 4) | (ch - '0');
}
case 'a' .. 'f':
{
num = (num << 4) | (ch - ('a' - 10));
}
case 'A' .. 'F':
{
num = (num << 4) | (ch - ('A' - 10));
}
default:
{
return -1;
}
}
}
while ((ch = string[stringPos]) > ' ' && ch != delim);
setarg(paramPos, 0, num);
}
case 'c':
{
setarg(paramPos, 0, string[stringPos++]);
}
case 'f':
{
{
#if defined isnull
if (isnull(string))
#else
if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
#endif
{
return format[0];
}
#pragma tabsize 4
new
formatPos = 0,
stringPos = 0,
paramPos = 2,
paramCount = numargs(),
delim = ' ';
while (string[stringPos] && string[stringPos] <= ' ')
{
stringPos++;
}
while (paramPos < paramCount && string[stringPos])
{
switch (format[formatPos++])
{
case '\0':
{
return 0;
}
case 'i', 'd':
{
new
neg = 1,
num = 0,
ch = string[stringPos];
if (ch == '-')
{
neg = -1;
ch = string[++stringPos];
}
do
{
stringPos++;
if ('0' <= ch <= '9')
{
num = (num * 10) + (ch - '0');
}
else
{
return -1;
}
}
while ((ch = string[stringPos]) > ' ' && ch != delim);
setarg(paramPos, 0, num * neg);
}
case 'h', 'x':
{
new
num = 0,
ch = string[stringPos];
do
{
stringPos++;
switch (ch)
{
case 'x', 'X':
{
num = 0;
continue;
}
case '0' .. '9':
{
num = (num << 4) | (ch - '0');
}
case 'a' .. 'f':
{
num = (num << 4) | (ch - ('a' - 10));
}
case 'A' .. 'F':
{
num = (num << 4) | (ch - ('A' - 10));
}
default:
{
return -1;
}
}
}
while ((ch = string[stringPos]) > ' ' && ch != delim);
setarg(paramPos, 0, num);
}
case 'c':
{
setarg(paramPos, 0, string[stringPos++]);
}
case 'f':
{
new changestr[16], changepos = 0, strpos = stringPos;
while(changepos < 16 && string[strpos] && string[strpos] != delim)
{
changestr[changepos++] = string[strpos++];
}
changestr[changepos] = '\0';
setarg(paramPos,0,_:floatstr(changestr));
}
case 'p':
{
delim = format[formatPos++];
continue;
}
case '\'':
{
new
end = formatPos - 1,
ch;
while ((ch = format[++end]) && ch != '\'') {}
if (!ch)
{
return -1;
}
format[end] = '\0';
if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
{
if (format[end + 1])
{
return -1;
}
return 0;
}
format[end] = '\'';
stringPos = ch + (end - formatPos);
formatPos = end + 1;
}
case 'u':
{
new
end = stringPos - 1,
id = 0,
bool:num = true,
ch;
while ((ch = string[++end]) && ch != delim)
{
if (num)
{
if ('0' <= ch <= '9')
{
id = (id * 10) + (ch - '0');
}
else
{
num = false;
}
}
}
if (num && IsPlayerConnected(id))
{
setarg(paramPos, 0, id);
}
else
{
#if !defined foreach
#define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
#define __SSCANF_FOREACH__
#endif
string[end] = '\0';
num = false;
new
name[MAX_PLAYER_NAME];
id = end - stringPos;
foreach (Player, playerid)
{
GetPlayerName(playerid, name, sizeof (name));
if (!strcmp(name, string[stringPos], true, id))
{
setarg(paramPos, 0, playerid);
num = true;
break;
}
}
if (!num)
{
setarg(paramPos, 0, INVALID_PLAYER_ID);
}
string[end] = ch;
#if defined __SSCANF_FOREACH__
#undef foreach
#undef __SSCANF_FOREACH__
#endif
}
stringPos = end;
}
case 's', 'z':
{
new
i = 0,
ch;
if (format[formatPos])
{
while ((ch = string[stringPos++]) && ch != delim)
{
setarg(paramPos, i++, ch);
}
if (!i)
{
return -1;
}
}
else
{
while ((ch = string[stringPos++]))
{
setarg(paramPos, i++, ch);
}
}
stringPos--;
setarg(paramPos, i, '\0');
}
default:
{
continue;
}
}
while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
{
stringPos++;
}
while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
{
stringPos++;
}
paramPos++;
}
do
{
if ((delim = format[formatPos++]) > ' ')
{
if (delim == '\'')
{
while ((delim = format[formatPos++]) && delim != '\'') {}
}
else if (delim != 'z')
{
return delim;
}
}
}
while (delim > ' ');
return 0;
}
while(changepos < 16 && string[strpos] && string[strpos] != delim)
{
changestr[changepos++] = string[strpos++];
}
changestr[changepos] = '\0';
setarg(paramPos,0,_:floatstr(changestr));
}
case 'p':
{
delim = format[formatPos++];
continue;
}
case '\'':
{
new
end = formatPos - 1,
ch;
while ((ch = format[++end]) && ch != '\'') {}
if (!ch)
{
return -1;
}
format[end] = '\0';
if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
{
if (format[end + 1])
{
return -1;
}
return 0;
}
format[end] = '\'';
stringPos = ch + (end - formatPos);
formatPos = end + 1;
}
case 'u':
{
new
end = stringPos - 1,
id = 0,
bool:num = true,
ch;
while ((ch = string[++end]) && ch != delim)
{
if (num)
{
if ('0' <= ch <= '9')
{
id = (id * 10) + (ch - '0');
}
else
{
num = false;
}
}
}
if (num && IsPlayerConnected(id))
{
setarg(paramPos, 0, id);
}
else
{
#if !defined foreach
#define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
#define __SSCANF_FOREACH__
#endif
string[end] = '\0';
num = false;
new
name[MAX_PLAYER_NAME];
id = end - stringPos;
foreach (Player, playerid)
{
GetPlayerName(playerid, name, sizeof (name));
if (!strcmp(name, string[stringPos], true, id))
{
setarg(paramPos, 0, playerid);
num = true;
break;
}
}
if (!num)
{
setarg(paramPos, 0, INVALID_PLAYER_ID);
}
string[end] = ch;
#if defined __SSCANF_FOREACH__
#undef foreach
#undef __SSCANF_FOREACH__
#endif
}
stringPos = end;
}
case 's', 'z':
{
new
i = 0,
ch;
if (format[formatPos])
{
while ((ch = string[stringPos++]) && ch != delim)
{
setarg(paramPos, i++, ch);
}
if (!i)
{
return -1;
}
}
else
{
while ((ch = string[stringPos++]))
{
setarg(paramPos, i++, ch);
}
}
stringPos--;
setarg(paramPos, i, '\0');
}
default:
{
continue;
}
}
while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
{
stringPos++;
}
while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
{
stringPos++;
}
paramPos++;
}
do
{
if ((delim = format[formatPos++]) > ' ')
{
if (delim == '\'')
{
while ((delim = format[formatPos++]) && delim != '\'') {}
}
else if (delim != 'z')
{
return delim;
}
}
}
while (delim > ' ');
return 0;
}
stock IsInBoat(playerid) {
new car = GetVehicleModel(GetPlayerVehicleID(playerid));
switch(car) {
case 430: {return 1;}
case 446: {return 1;}
case 452: {return 1;}
case 453: {return 1;}
case 454: {return 1;}
case 472: {return 1;}
case 473: {return 1;}
case 484: {return 1;}
case 493: {return 1;}
case 595: {return 1;}
}
return 0;
}
new car = GetVehicleModel(GetPlayerVehicleID(playerid));
switch(car) {
case 430: {return 1;}
case 446: {return 1;}
case 452: {return 1;}
case 453: {return 1;}
case 454: {return 1;}
case 472: {return 1;}
case 473: {return 1;}
case 484: {return 1;}
case 493: {return 1;}
case 595: {return 1;}
}
return 0;
}
stock IsInBike(playerid) {
new car = GetVehicleModel(GetPlayerVehicleID(playerid));
switch(car) {
case 448: {return 1;}
case 461: {return 1;}
case 463: {return 1;}
case 468: {return 1;}
case 521: {return 1;}
case 522: {return 1;}
case 523: {return 1;}
case 581: {return 1;}
case 586: {return 1;}
}
return 0;
}
new car = GetVehicleModel(GetPlayerVehicleID(playerid));
switch(car) {
case 448: {return 1;}
case 461: {return 1;}
case 463: {return 1;}
case 468: {return 1;}
case 521: {return 1;}
case 522: {return 1;}
case 523: {return 1;}
case 581: {return 1;}
case 586: {return 1;}
}
return 0;
}
stock IsInPlane(playerid) {
new car = GetVehicleModel(GetPlayerVehicleID(playerid));
switch(car) {
case 460: {return 1;}
case 476: {return 1;}
case 511: {return 1;}
case 512: {return 1;}
case 513: {return 1;}
case 519: {return 1;}
case 520: {return 1;}
case 553: {return 1;}
case 577: {return 1;}
case 592: {return 1;}
case 593: {return 1;}
case 447: {return 1;}
case 469: {return 1;}
}
return 0;
}
new car = GetVehicleModel(GetPlayerVehicleID(playerid));
switch(car) {
case 460: {return 1;}
case 476: {return 1;}
case 511: {return 1;}
case 512: {return 1;}
case 513: {return 1;}
case 519: {return 1;}
case 520: {return 1;}
case 553: {return 1;}
case 577: {return 1;}
case 592: {return 1;}
case 593: {return 1;}
case 447: {return 1;}
case 469: {return 1;}
}
return 0;
}
stock IsInCar(playerid) {
new car = GetVehicleModel(GetPlayerVehicleID(playerid));
if(car == 0) return 0;
if(!IsInPlane(playerid) && !IsInBike(playerid) && !IsInBoat(playerid)) return 1;
return 0;
}
new car = GetVehicleModel(GetPlayerVehicleID(playerid));
if(car == 0) return 0;
if(!IsInPlane(playerid) && !IsInBike(playerid) && !IsInBoat(playerid)) return 1;
return 0;
}
/*
########### MySQL-Abteilung
*/
stock loadPlayer(playerid) {
new query[128], n[MAX_PLAYER_NAME];
GetPlayerName(playerid, n, sizeof(n));
format(query, sizeof(query), "SELECT * FROM users WHERE Name='%s'", n);
mysql_function_query(dbhandle, query, true, "UserLoad", "i", playerid);
return 1;
}
new query[128], n[MAX_PLAYER_NAME];
GetPlayerName(playerid, n, sizeof(n));
format(query, sizeof(query), "SELECT * FROM users WHERE Name='%s'", n);
mysql_function_query(dbhandle, query, true, "UserLoad", "i", playerid);
return 1;
}
public UserCheck(playerid) {
new num_rows, num_field;
cache_get_data(num_rows, num_field, dbhandle);
if(num_rows == 0) {
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registrierung", "Dieser Username wurde nicht in der Datenbank gefunden.\nBitte gebe dein gewünschtes Passwort ein:", "Absenden", "Abbrechen");
} else {
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Dieser Username wurde in der Datenbank gefunden.\nBitte gebe dein Passwort ein:", "Login", "Abbrechen");
}
}
new num_rows, num_field;
cache_get_data(num_rows, num_field, dbhandle);
if(num_rows == 0) {
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registrierung", "Dieser Username wurde nicht in der Datenbank gefunden.\nBitte gebe dein gewünschtes Passwort ein:", "Absenden", "Abbrechen");
} else {
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Dieser Username wurde in der Datenbank gefunden.\nBitte gebe dein Passwort ein:", "Login", "Abbrechen");
}
}
public UserLoad(playerid) {
return 1;
}
}
public OnPasswordResponse(playerid)
{
new num_fields,num_rows;
cache_get_data(num_rows,num_fields,dbhandle);
if(num_rows==1)
{
//Passwort richtig
SetPlayerScore(playerid, cache_get_field_content_int(0, "Level", dbhandle));
SetPlayerSkin(playerid, cache_get_field_content_int(0, "Skin", dbhandle));
GivePlayerMoney(playerid, cache_get_field_content_int(0, "Geld", dbhandle));
SetPVarInt(playerid, "id", cache_get_field_content_int(0, "id", dbhandle));
SetPVarInt(playerid, "AutoLic", cache_get_field_content_int(0, "AutoLic", dbhandle));
SetPVarInt(playerid, "BikeLic", cache_get_field_content_int(0, "BikeLic", dbhandle));
SetPVarInt(playerid, "BootLic", cache_get_field_content_int(0, "BootLic", dbhandle));
SetPVarInt(playerid, "FlyLic", cache_get_field_content_int(0, "FlyLic", dbhandle));
SetPVarInt(playerid, "WaffenLic", cache_get_field_content_int(0, "WaffenLic", dbhandle));
SetPVarInt(playerid, "AdminLevel", cache_get_field_content_int(0, "AdminLevel", dbhandle));
SetPVarInt(playerid, "Fraktion", cache_get_field_content_int(0, "Fraktion", dbhandle));
SetPVarInt(playerid, "Rang", cache_get_field_content_int(0, "Rang", dbhandle));
if(cache_get_field_content_int(0, "Tutorial", dbhandle) == 1) {
ShowPlayerDialog(playerid, DIALOG_TUTORIAL_REQUEST, DIALOG_STYLE_MSGBOX, "Tutorial?", "Willst du dir das Tutorial anschauen?", "Ja", "Nein");
return 1;
}
SpawnPlayer(playerid);
}
else
{
//Passwort falsch
SendClientMessage(playerid,COLOR_RED,"Das eingegebene Passwort ist falsch.");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gibt bitte dein Passwort ein:","Okay","Abbrechen");
}
return 1;
}
{
new num_fields,num_rows;
cache_get_data(num_rows,num_fields,dbhandle);
if(num_rows==1)
{
//Passwort richtig
SetPlayerScore(playerid, cache_get_field_content_int(0, "Level", dbhandle));
SetPlayerSkin(playerid, cache_get_field_content_int(0, "Skin", dbhandle));
GivePlayerMoney(playerid, cache_get_field_content_int(0, "Geld", dbhandle));
SetPVarInt(playerid, "id", cache_get_field_content_int(0, "id", dbhandle));
SetPVarInt(playerid, "AutoLic", cache_get_field_content_int(0, "AutoLic", dbhandle));
SetPVarInt(playerid, "BikeLic", cache_get_field_content_int(0, "BikeLic", dbhandle));
SetPVarInt(playerid, "BootLic", cache_get_field_content_int(0, "BootLic", dbhandle));
SetPVarInt(playerid, "FlyLic", cache_get_field_content_int(0, "FlyLic", dbhandle));
SetPVarInt(playerid, "WaffenLic", cache_get_field_content_int(0, "WaffenLic", dbhandle));
SetPVarInt(playerid, "AdminLevel", cache_get_field_content_int(0, "AdminLevel", dbhandle));
SetPVarInt(playerid, "Fraktion", cache_get_field_content_int(0, "Fraktion", dbhandle));
SetPVarInt(playerid, "Rang", cache_get_field_content_int(0, "Rang", dbhandle));
if(cache_get_field_content_int(0, "Tutorial", dbhandle) == 1) {
ShowPlayerDialog(playerid, DIALOG_TUTORIAL_REQUEST, DIALOG_STYLE_MSGBOX, "Tutorial?", "Willst du dir das Tutorial anschauen?", "Ja", "Nein");
return 1;
}
SpawnPlayer(playerid);
}
else
{
//Passwort falsch
SendClientMessage(playerid,COLOR_RED,"Das eingegebene Passwort ist falsch.");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gibt bitte dein Passwort ein:","Okay","Abbrechen");
}
return 1;
}