Hey
Nach meiner 'langen' Scriptpause habe ich mich mal wieder an die Arbeit gemacht, und scheitere schon beim Loginsystem.
Gerade den "Registerteil" fertig, doch wenn ich nun auf Spawn drücke kommt das:
#include <a_samp>
#include <dini>
#include <ocmd>
#include <sscanf2>
#define HellRot 0xFF0900FF
#define DunkelRot 0xAB0000FF
#define HellGruen 0x00F500FF
#define DunkelGruen 0x00AB00FF
#define HellBlau 0x0080FFFF
#define DunkelBlau 0x0000ABFF
#define Gelb 0xE9EA00FF
#define Pink 0xFF008CFF
#define Orange 0xFF8400FF
#define Schwarz 0x000000FF
#define Weiss 0xFFFFFFFF
#define DunkelRot 0xAB0000FF
#define HellGruen 0x00F500FF
#define DunkelGruen 0x00AB00FF
#define HellBlau 0x0080FFFF
#define DunkelBlau 0x0000ABFF
#define Gelb 0xE9EA00FF
#define Pink 0xFF008CFF
#define Orange 0xFF8400FF
#define Schwarz 0x000000FF
#define Weiss 0xFFFFFFFF
#define Dialog_Register 1
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
public OnGameModeInit()
{
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
{
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
{
return 1;
}
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
{
return 1;
}
public OnPlayerSpawn(playerid)
{
new pfad[64];
format(pfad,sizeof(pfad),"/Spielerdaten/%s.txt",PlayerName(playerid));
if(dini_Exists(pfad)){
ShowPlayerDialog(playerid,Dialog_Register,DIALOG_STYLE_INPUT,"Willkommen auf SERVERNAME","Willkommen auf SERVERNAME.\nDa du noch keinen Account hast musst du dich registrieren.\nGib dazu einfach ein Passwort ein.","Registrieren","Abbrechen");
}
else{
{
new pfad[64];
format(pfad,sizeof(pfad),"/Spielerdaten/%s.txt",PlayerName(playerid));
if(dini_Exists(pfad)){
ShowPlayerDialog(playerid,Dialog_Register,DIALOG_STYLE_INPUT,"Willkommen auf SERVERNAME","Willkommen auf SERVERNAME.\nDa du noch keinen Account hast musst du dich registrieren.\nGib dazu einfach ein Passwort ein.","Registrieren","Abbrechen");
}
else{
}
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("/mycommand", cmdtext, true, 10) == 0)
{
return 1;
}
return 0;
}
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
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)
{
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==0){
SendClientMessage(playerid,HellGruen,"Du hast dich erfolgreich registriert! Viel Spaß auf dem Server.");
SetPlayerPos(playerid,1166.5662,-1490.1498,22.7551);
SetPlayerFacingAngle(playerid,88.4906);
SetCameraBehindPlayer(playerid);
}
else{
SendClientMessage(playerid,HellRot,"Du hast den Registriervorgang abgebrochen.");
Kick(playerid);
}
}*/
return 1;
}
{
/*if(dialogid==Dialog_Register){
if(response==0){
SendClientMessage(playerid,HellGruen,"Du hast dich erfolgreich registriert! Viel Spaß auf dem Server.");
SetPlayerPos(playerid,1166.5662,-1490.1498,22.7551);
SetPlayerFacingAngle(playerid,88.4906);
SetCameraBehindPlayer(playerid);
}
else{
SendClientMessage(playerid,HellRot,"Du hast den Registriervorgang abgebrochen.");
Kick(playerid);
}
}*/
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
{
return 1;
}
stock PlayerName(playerid){
new pName[16];
GetPlayerName(playerid,pName,sizeof(pName));
return pName;
}
new pName[16];
GetPlayerName(playerid,pName,sizeof(pName));
return pName;
}
stock SpielerSpeichern(playerid){
new pfad[64],Float:Leben;
format(pfad,sizeof(pfad),"/Spielerdaten/%s.txt",PlayerName(playerid));
if(dini_Exists(pfad)){
dini_IntSet(pfad,"Leben",GetPlayerHealth(playerid,Leben));
dini_IntSet((pfad,"Geld",GetPlayerMoney(playerid));
}
else{
}
}
new pfad[64],Float:Leben;
format(pfad,sizeof(pfad),"/Spielerdaten/%s.txt",PlayerName(playerid));
if(dini_Exists(pfad)){
dini_IntSet(pfad,"Leben",GetPlayerHealth(playerid,Leben));
dini_IntSet((pfad,"Geld",GetPlayerMoney(playerid));
}
else{
}
}
stock SpielerLaden(playerid){
new pfad[64],Float:Leben;
format(pfad,sizeof(pfad),"/Spielerdaten/%s.txt",PlayerName(playerid));
if(dini_Exists(pfad)){
SetPlayerHealth(playerid,dini_Int(pfad,"Leben"));
GivePlayerMoney(playerid,dini_Int(pfad,"Geld"));
}
else{
}
}
new pfad[64],Float:Leben;
format(pfad,sizeof(pfad),"/Spielerdaten/%s.txt",PlayerName(playerid));
if(dini_Exists(pfad)){
SetPlayerHealth(playerid,dini_Int(pfad,"Leben"));
GivePlayerMoney(playerid,dini_Int(pfad,"Geld"));
}
else{
}
}