Hab ein Login System mit Hilfe von dem Youtube Tutorial von Nemesus erstellt es macht mir aber 4 Errors und ich weiß nicht mehr weiter ich würde mich freuen wenn ihr mir helfen könntet
Hier meine errors:
C:\Program Files\Rockstar Games\gamemodes\Untitled.pwn(2332) : warning 225: unreachable code
C:\Program Files\Rockstar Games\gamemodes\Untitled.pwn(2385) : warning 209: function "ocmdOnPlayerCommandText" should return a value
C:\Program Files\Rockstar Games\gamemodes\Untitled.pwn(3413) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\gamemodes\Untitled.pwn(3413) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\gamemodes\Untitled.pwn(3413 -- 3415) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\gamemodes\Untitled.pwn(3413 -- 3415) : fatal error 107: too many error messages on one line
4 Errors.
Und hier mein Script musste leider par Autos und so rauslöschen aber die sind ja nicht so wichtig :
#include <a_samp>
#include <OCMD>
#include <Dini>
#include <md5>
#define Blau 0x0041FFFF
#define Weiss 0xFFFFFFFF
#define Gelb 0xE1FF00FF
#define Orange 0xFF6400FF
forward CloseoGate();
forward CloseroGate();
forward CloseruGate();
forward CloseArmyGate();
forward CloselGate();
forward ClosepGate();
forward CloserGate();
forward Closeatgate();
//Dialoge
#define REGISTER 1
#define LOGIN 2
#define Login
//Enums
enum SpielerDaten
{
Adminlevel,
Level,
Fraktion,
Team,
sLogin
};
new sSpieler[MAX_PLAYERS][SpielerDaten];
new SAPD[111];
new Army[49];
new News[14];
new Fahrschule[16];
new Oamt[16];
new Medic[34];
new Triarden[43];
new Mafia[13];
new Ballas[16];
new Grove[11];
new Bus[10];
new Taxi[67];
new Sf_Rifa[12];
new Vagos[13];
new Chopper[23];
new Trucker[9];
new Muellabfuhr[10];
new AT[49];
new armygate;
new bsnexit;
new bsnenter;
new ammuenter;
new ammuexit;
new lspdenter;
new lspdexit;
new groventer;
new grovexit;
new donutenter;
new donutexit;
new cluckinenter;
new cluckinexit;
new rathausenter;
new rathausexit;
new banklsenter;
new banklsexit;
new vagosenter;
new vagosexit;
new ballasenter;
new ballasexit;
new oamtenter;
new oamtexit;
new sfpdenter;
new sfpdexit;
new pizzaenter;
new pizzaexit;
new fahrschulenter;
new fahrschulexit;
new chopperenter;
new chopperexit;
new medicenter;
new medicexit;
new newsenter;
new newsexit;
new ammusfenter;
new ammusfexit;
new rifaenter;
new rifaexit;
new atenter;
new atexit;
new triadenenter;
new triadenexit;
new lvpdenter;
new lvpdexit;
new lspdtgenter;
new sfpdtgenter;
new lvpdtgenter;
new lvpdexittg;
new sfpdexittg;
new lspdexittg;
new SpielerReset;
new rugate;
new rogate;
new lgate;
new pgate;
new rgate;
new ogate;
new atgate;
new casinoenter;
new casinoexit;
new telefschule;
new telefsu;
new wetterid;
new WetterRandom[][] = {
{1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10},
{11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {20},
{23}, {24}, {25}, {26}, {27}, {28}, {29}, {30},
{32}, {34}, {35}, {37}, {38}, {39}, {40},
{41}
};
forward WetterTimer();
main()
{
print("\n----------------------------------");
print(" German Reallife");
print("----------------------------------\n");
}
public OnGameModeInit()
{
WetterTimer();
SetTimer("WetterTimer", 420000, 1);
SetGameModeText("German Reallife");
EnableStuntBonusForAll(0);
DisableInteriorEnterExits();
//Eingänge
bsnexit=CreatePickup(1559,1,363.0169,-75.0290,1001.5078);
bsnenter=CreatePickup(1559,1,1199.2434,-918.1447,43.1233);
ammuenter=CreatePickup(1559,1,1368.9873,-1279.6979,13.5469);
ammuexit=CreatePickup(1559,1,285.4651,-41.8050,1001.5156);
lspdenter=CreatePickup(1559,1,1555.5056,-1675.7213,16.1953);
lspdexit=CreatePickup(1559,1,246.8283,62.3289,1003.6406);
groventer=CreatePickup(1559,1,2495.4570,-1691.1393,14.7656);
grovexit=CreatePickup(1559,1,2495.9797,-1692.1062,1014.7422);
donutenter=CreatePickup(1559,1,1038.1726,-1340.7327,13.7451);
donutexit=CreatePickup(1559,1,377.1774,-193.3036,1000.6328);
cluckinenter=CreatePickup(1559,1,928.9160,-1352.9095,13.3438);
cluckinexit=CreatePickup(1559,1,364.9827,-11.8444,1001.8516);
rathausenter=CreatePickup(1559,1,1310.0514,-1366.7965,13.5063);
rathausexit=CreatePickup(1559,1,390.7696,173.8698,1008.382);
banklsenter=CreatePickup(1559,1,1727.0286,-1637.0398,20.2174);
banklsexit=CreatePickup(1559,1,2315.5964,0.3551,26.7422);
vagosenter=CreatePickup(1559,1,2800.6604,-1464.8324,40.0501);
vagosexit=CreatePickup(1559,1,2468.8379,-1698.2087,1013.5078);
ballasenter=CreatePickup(1559,1,2233.9844,-1333.2395,23.9815);
ballasexit=CreatePickup(1559,1,2524.0864,-1679.3413,1015.4986);
oamtenter=CreatePickup(1559,1,-520.4037,-538.9203,25.5234);
oamtexit=CreatePickup(1559,1,1419.7354,-34.8359,1000.92199);
sfpdenter=CreatePickup(1559,1,-1605.5369,710.2728,13.8672);
sfpdexit=CreatePickup(1559,1,246.4989,107.2977,1003.2188);
pizzaenter=CreatePickup(1559,1,-1720.9471,1359.6906,7.1853);
pizzaexit=CreatePickup(1559,1,372.3520,-133.5226,1001.4922);
fahrschulenter=CreatePickup(1559,1,-1754.1812,964.1254,24.8906);
fahrschulexit=CreatePickup(1559,1,-2026.9126,-103.6039,1035.1826);
chopperenter=CreatePickup(1559,1,-2173.5759,992.9139,80.0000);
chopperexit=CreatePickup(1559,1,514.0455,-7.6855,1001.5653);
medicenter=CreatePickup(1559,1,-2655.0566,640.1638,14.4545);
medicexit=CreatePickup(1559,1,1038.3124,-3.7798,1001.2845);
newsenter=CreatePickup(1559,1,-2521.1719,-624.9511,132.7839);
newsexit=CreatePickup(1559,1,1700.5278,-1667.7944,20.2188);
ammusfenter=CreatePickup(1559,1,-2224.3701,331.9798,35.3203);
ammusfexit=CreatePickup(1559,1,285.7962,-86.7312,1001.5229);
rifaenter=CreatePickup(1559,1,-2717.6943,-317.4846,7.8438);
rifaexit=CreatePickup(1559,1,2324.5012,-1149.5416,1050.7101);
atenter=CreatePickup(1559,1,937.0842,1733.6517,8.8516);
atexit=CreatePickup(1559,1,-2158.6829,643.1343,1052.3750);
triadenenter=CreatePickup(1559,1,1455.9154,751.0394,11.0234);
triadenexit=CreatePickup(1559,1,2807.6748,-1174.7562,1025.5703);
lvpdenter=CreatePickup(1559,1,2287.0488,2432.3679,10.8203);
lvpdexit=CreatePickup(1559,1,288.7050,167.0396,1007.1719);
lspdtgenter=CreatePickup(1559,1,1524.4872,-1677.8593,6.2188);
sfpdtgenter=CreatePickup(1559,1,-1606.3065,672.0656,-4.9063);
lvpdtgenter=CreatePickup(1559,1,2268.0259,2449.2847,3.5313);
lvpdexittg=CreatePickup(1559,1,238.4367,139.6144,1003.0234);
sfpdexittg=CreatePickup(1559,1,215.5772,126.7357,1003.2188);
lspdexittg=CreatePickup(1559,1,246.3964,88.0092,1003.6406);
casinoenter=CreatePickup(1559,1,2196.9653,1677.0592,12.3672);
casinoexit=CreatePickup(1559,1,2019.0719,1017.8632,996.8750);
telefschule=CreatePickup(1559,1,-1764.7283,961.7507,24.8828);
telefsu=CreatePickup(1559,1,-1754.9352,966.8770,95.8438);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SpawnPlayer(playerid);
return 1;
}
public OnPlayerConnect(playerid)
{
//NPC/Bot Abfrage
if(IsPlayerNPC(playerid)) return 1;
new Spieler[64];
new Sname[MAX_PLAYER_NAME];
GetPlayerName(playerid,Sname,sizeof(Sname));
format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",Sname);
if(dini_Exists(Spieler))
{
SendClientMessage(playerid,Blau,"Herzlich Willkommen auf German Reallife San Andreas!!");
ShowPlayerDialog(playerid,LOGIN,DIALOG_STYLE_INPUT,"Login","Dein Account wurde in unserer Datenbank gefunden, bitte gebe nun dein Passwort ein und logge dich somit ein.","Login","Abbrechen");
return 1;
}
else
{
SendClientMessage(playerid,Blau,"Herzlich Willkommen auf German Reallife San Andreas!!");
ShowPlayerDialog(playerid,REGISTER,DIALOG_STYLE_INPUT,"Registrieren","Bitte wähle ein Passwort um dir einen Account zu erstellen!","Registrieren","Abbrechen");
return 1;
}
DisableInteriorEnterExits();
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
//NPC/Bot Abfrage
if(IsPlayerNPC(playerid)) return 1;
sSpieler[playerid][sLogin] = 0;
SpielerSpeichern(playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
GivePlayerMoney(playerid,10000);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
GivePlayerMoney(playerid,-150);
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == LOGIN)
{
if(response == 0)
{
SendClientMessage(playerid,0xFF0000FF,"Du hast den Loginprozess abgebrochen");
Kick(playerid);
return 1;
}
if(response == 1)
{
Login(playerid,MD5_Hash(inputtext));
return 1;
}
}
if(dialogid == REGISTER)
{
if(response == 0)
{
SendClientMessage(playerid,Blau,"Du hast den Registrierungs Vorgang abgebrochen");
Kick(playerid);
return 1;
}
if(response == 1)
{
if(!strlen(inputtext))
{
SendClientMessage(playerid,Blau,"Bitte gebe ein Passwort ein");
ShowPlayerDialog(playerid,REGISTER,DIALOG_STYLE_INPUT,"Registrieren","Bitte wähle ein Passwort um dir einen Account zu erstellen!","Registrieren","Abbrechen");
return 1;
}
Register(playerid,inputtext);
return 1;
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
public CloseArmyGate()
{
MoveObject(armygate, -1534.55, 482.29, 6.17,10);
return 1;
}
public CloseruGate()
{
MoveObject(rugate,-2804.59, -325.76, 6.13,10);
return 1;
}
public CloseroGate()
{
MoveObject(rogate, -2658.93, -220.29, 3.39,10);
return 1;
}
public CloselGate()
{
MoveObject(lgate, -2898.73, 67.51, 4.06,10);
return 1;
}
public ClosepGate()
{
MoveObject(pgate,1241.26, -767.17, 91.15,10);
return 1;
}
public CloserGate()
{
MoveObject(rgate,-2050.67, -102.17, 34.15,10);
return 1;
}
public CloseoGate()
{
MoveObject(rgate,-488.70, -562.95, 24.50,10);
return 1;
}
public Closeatgate()
{
MoveObject(atgate,996.90, 1715.33, 9.91,5);
return 1;
}
public WetterTimer()
{
new rand = random(sizeof(WetterRandom)); // Hier wird eine Zufalls Zahl "geniriert".
new stringw[16]; // Buchstaben/Zahlen Summe
wetterid = WetterRandom[rand][0]; // wetterid, ruft ab, welche Zahl der Zufall "geniriert" hat.
format(stringw, sizeof(stringw), "weather %d", wetterid);
SendRconCommand(stringw); // Setzt das Wetter auf dieZufall geniriete Zahl
printf("Wetter ID: %d", wetterid); // Gibt euch in der Console die Nachricht, welche Wetter ID das System "geniriert" hat-
return 1;
}
stock Register(playerid,key[])
{
new Spielerdatei[64];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Spielerdatei,sizeof(Spielerdatei),"/Spieler/%s.txt",name);
if(!dini_Exists(Spielerdatei))
{
dini_Create(Spielerdatei);
dini_Set(Spielerdatei,"Passwort",key);
SendClientMessage(playerid, 0x0041FFFF,"Erfolgreich regestriert.");
dini_IntSet(Spielerdatei,"Level",0);
SetPlayerScore(playerid,0);
SetPVarInt(playerid,"loggedin",1);
return 1;
}
stock Login(playerid,key[])
{
new Spieler[64];
new Sname[MAX_PLAYER_NAME];
GetPlayerName(playerid,Sname,sizeof(Sname));
format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",Sname);
if(!strcmp(Key,dini_Get(Spieler,"Passwort"),true))
{
SendClientMessage(playerid,0x0041FFFF,"Erfolgreich eingeloggt!");
}
else
{
SendClientMessage(playerid,0xFF0000FF,"Falsches Passwort!!");
Kick(playerid);
}
return 1;
}
stock SpielerSpeichern(playerid)
{
new Spieler[64];
new Sname[MAX_PLAYER_NAME];
GetPlayerName(playerid,Sname,sizeof(Sname));
format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",Sname);
if(dini_Exists(Spieler))
{
dini_IntSet(Spieler,"Adminlevel",sSpieler[playerid][Adminlevel]);
dini_IntSet(Spieler,"Level",sSpieler[playerid][Level]);
dini_IntSet(Spieler,"Fraktion",sSpieler[playerid][Fraktion]);
dini_IntSet(Spieler,"Team",sSpieler[playerid][Team]);
}
return 1;
}
stock SpielerLaden(playerid)
{
new Spieler[64];
new Sname[MAX_PLAYER_NAME];
GetPlayerName(playerid,Sname,sizeof(Sname));
format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",Sname);
if(dini_Exists(Spieler))
{
SetPlayerScore(playerid,dini_Int(Spieler,"Level"));
sSpieler[playerid][Adminlevel] = dini_Int(Spieler,"Adminlevel");
sSpieler[playerid][Level] = dini_Int(Spieler,"Level");
sSpieler[playerid][Fraktion] = dini_Int(Spieler,"Fraktion");
sSpieler[playerid][Team] = dini_Int(Spieler,"Team");
sSpieler[playerid][sLogin] = 1;
SpawnPlayer(playerid);
}
return 1;
}