Hi leute, ich bins mal wider der Alberto. Also ich habe ein neun gm angefangen aber habe auch register gemacht aber wollte frage wie ich daraus gui mach? kann mir wer machen?
#include <a_samp>
#include <dini>
#include <Dudb>
//Farben
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_CYAN 0x00BFF3AA
#define COLOR_BLACK 0x000000AA
#define COLOR_BROWN 0XA52A2AAA
#define COLOR_GOLD 0xB8860BAA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_LAWNGREEN 0x7CFC00AA
#define COLOR_LIMEGREEN 0x32CD32AA
#define COLOR_OLIVE 0x808000AA
#define COLOR_SEAGREEN 0x2E8B57AA
#define COLOR_TOMATO 0xFF6347AA
#define COLOR_YELLOWGREEN 0x9ACD32AA
#define COLOR_MEDIUMAQUA 0x83BFBFAA
#define COLOR_FLBLUE 0x6495EDAA
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_PURPLE 0x800080AA
#define COLOR_GRELLRED 0xFF000000
#define COLOR_LIGHTGREEN 0x86FF59FF
#define COLOR_LIGHTBLUE 0x33CCFFAA
#pragma unused ret_memcpy
enum Info
{
passwort[128],
alevel,
skin,
};
new bool:loggedin[MAX_PLAYERS];
new pInfo[MAX_PLAYERS][Info];
main()
{
print("-----------------------------------------");
print(" ^^ ");
print("-----------------------------------------");
}
public OnGameModeInit()
{
EnableStuntBonusForAll(0);
UsePlayerPedAnims();
ShowPlayerMarkers(0);
DisableInteriorEnterExits();
SetGameModeText("?");
AddPlayerClass(101,1193.2167,-1266.1366,23.6099,2.9239,0,0,0,0,0,0);
return 1;
}
public OnGameModeExit()
{
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;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnPlayerConnect(playerid)
{
new name[128], save[128];
GetPlayerName(playerid,name,sizeof(name));
format(save,sizeof(save),"/Spieler/%s.user",name);
if(dini_Exists(save))
{
SendClientMessage(playerid, COLOR_YELLOW, "*** Willkommen Zurück, Logge dich mit /login [Passwort] ein");
GivePlayerMoney(playerid,dini_Int(save,"Geld"));
SetPlayerSkin(playerid,dini_Int(save,"Skin"));
pInfo[playerid][alevel] =dini_Int(save,"Adminlevel");
}
else
{
if(!dini_Exists(save))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "~Wilkommen. Nutze /register [Password]~");
}
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new name[128], save[128];
GetPlayerName(playerid,name,sizeof(name));
format(save,sizeof(save),"/Spieler/%s.user",name);
if(dini_Exists(save))
{
dini_IntSet(save,"Geld",GetPlayerMoney(playerid));
dini_IntSet(save,"Wanteds",GetPlayerWantedLevel(playerid));
dini_IntSet(save,"Skin",GetPlayerSkin(playerid));
dini_IntSet(save,"Adminlevel",pInfo[playerid][alevel]);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
new name[128], save[128];
GetPlayerName(playerid,name,sizeof(name));
format(save,sizeof(save),"/Spieler/%s.user",name);
if(loggedin[playerid] == false)
{
Kick(playerid);
}
SetPlayerSkin(playerid,dini_Int(save,"Skin"));
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new spieler[MAX_PLAYER_NAME];
new gegner[MAX_PLAYER_NAME];
if(strcmp(strget(cmdtext,0), "/register", true) == 0)
{
new save[40];
GetPlayerName(playerid,spieler,sizeof(spieler));
format(save, sizeof(save),"Spieler/%s.user",spieler);
if(!dini_Exists(save))
{
dini_Create(save);
dini_IntSet(save,"passwort",udb_hash(strget(cmdtext,1)));
SendClientMessage(playerid, COLOR_GREEN, "***Dein Account wurde erfolgreich registriert***");
SendClientMessage(playerid, COLOR_GREEN, "***Nutze /login [Passwort] um dich einzuloggen***");
}
else
{
if(dini_Exists(save))
{
SendClientMessage(playerid, COLOR_RED, "Der Account ist bereits registriert");
}}
return 1;
}
if(strcmp(strget(cmdtext,0), "/login", true) == 0)
{
new save[40], s2[256];
GetPlayerName(playerid,spieler,sizeof(spieler));
format(save,sizeof(save),"Spieler/%s.user",spieler);
if(dini_Exists(save))
{
s2=dini_Get(save,"passwort");
if(strval(s2)==udb_hash(strget(cmdtext,1)))
{
loggedin[playerid] = true;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "***Du hast dich erfolgreich eingeloggt***");
}
else
{
SendClientMessage(playerid, COLOR_RED, "Passwort Falsch!");
}}
return 1;
}
if(strcmp(cmdtext,"/makeadmin", true) == 0)
{
if(pInfo[playerid][alevel] == 6)
{
new ziel = strval(strget(cmdtext,1));
new level= strval(strget(cmdtext,2));
{
if(!strlen(strget(cmdtext,1))) return SendClientMessage(playerid, COLOR_RED, "Benutzte: /makeadmin [ID] [AdminLevel]");
{
if(!strlen(strget(cmdtext,2))) return SendClientMessage(playerid, COLOR_RED, "Benutzte: /makeadmin [ID] [AdminLevel]");
{
if(level==0)
{
new save[40];
GetPlayerName(ziel,gegner,sizeof(gegner));
format(save,sizeof(save),"/Spieler/%s.user",gegner);
pInfo[ziel][alevel] = 0;
dini_IntSet(save,"Adminlevel",0);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "|___________Zivi___________|");
SendClientMessage(playerid, COLOR_GREY, "Du bist nun wieder Zivilist!");
SendClientMessage(playerid, COLOR_GREY, "Admin Level: 0");
if(level==1)
{
GetPlayerName(ziel,gegner,sizeof(gegner));
format(save,sizeof(save),"/Spieler/%s.ini",gegner);
pInfo[ziel][alevel] = 1;
dini_IntSet(save,"Adminlevel",1);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "|___________Supporter___________|");
SendClientMessage(playerid, COLOR_GREY, "Du wurdest zu den Supportern gestuft/gekickt.");
SendClientMessage(playerid, COLOR_GREY, "Admin Level: 1");
}
if(level==2)
{
GetPlayerName(ziel,gegner,sizeof(gegner));
format(save,sizeof(save),"/Spieler/%s.ini",gegner);
pInfo[ziel][alevel] = 2;
dini_IntSet(save,"Adminlevel",2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "|___________Moderator___________|");
SendClientMessage(playerid, COLOR_GREY, "Du wurdest zu den Moderatoren gestuft/gekickt.");
SendClientMessage(playerid, COLOR_GREY, "Admin Level: 2");
}
if(level==3)
{
GetPlayerName(ziel,gegner,sizeof(gegner));
format(save,sizeof(save),"/Spieler/%s.ini",gegner);
pInfo[ziel][alevel] = 3;
dini_IntSet(save,"Adminlevel",3);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "|___________Admin___________|");
SendClientMessage(playerid, COLOR_GREY, "Du wurdest zu den Azubi Admins gestuft/gekickt.");
SendClientMessage(playerid, COLOR_GREY, "Admin Level: 3");
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "|______KeinAdmin!______|");
SendClientMessage(playerid, COLOR_GREY, "Du bist kein Admin!");
SendClientMessage(playerid, COLOR_GREY, "Deine Admin Stufe ist 0");
SendClientMessage(playerid, COLOR_GREY, "Und kannst somit keine Admin befehle ausführen!");
}}}}}}
return 1;
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 0;
}
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 OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
stock strget(strx[], pos, search = ' ') {
new arg, ret[128], idxx;
for (new i = 0; i < strlen(strx); i++) {
if(strx[i] == search || i == strlen(strx) || strx[i + 1] == 10) {
arg++;
if (arg == pos + 1){
ret[i-idxx] = EOS;
return ret;
} else if (arg == pos)
idxx= i+1;
}
else if (arg == pos)
ret[i - idxx] = strx[i];
}
return ret;
}
Kein angst habe auser diese nix dran gemacht. Hoff mir kann einer mein User system in Gui User system machen.