Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <dini>
- #define file "moje_zeme/%s.cfg"
- #define login 0
- #define SCM SendClientMessage
- #define LBLUE 0x33CCFFAA
- #define BLUE 0x0000FFAA
- #define GREEN 0x33AA33AA
- #define RED 0xFF0000FF
- #define WHITE 0xFFFFFFAA
- #define ORANGE 0xFF9933AA
- #define PINK 0xFF66FFAA
- #define BLACK 0x000000AA
- new stringX[256];
- new stringY[256];
- new prihlasen[MAX_PLAYERS];
- #pragma tabsize 0
- main()
- {
- print("\n----------------------------------");
- print(" Moje země ");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- SetGameModeText("Moje země");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerInterior(playerid, 1);
- SetPlayerPos(playerid, -792.55279541,509.08712769,1371.39135742);
- SetPlayerCameraPos(playerid, -792.55279541,509.08712769,1371.39135742);
- SetPlayerCameraLookAt(playerid, -789.44763184,503.70260620,1371.70458984);
- if(prihlasen[playerid]==0){
- format(stringX, 256, file, PlayerName(playerid));
- if(dini_Exists(stringX) == 1){
- ShowPlayerDialog(playerid,login,DIALOG_STYLE_INPUT,"Přihlášení","Vaše heslo:","Přihlásit","");
- }else{
- ShowPlayerDialog(playerid,login,DIALOG_STYLE_INPUT,"Registrace","Zaregistrujte se:","Registrovat","");
- }
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerInterior(playerid, 0);
- 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[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- return 1;
- }
- return 0;
- }
- 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)
- {
- if(prihlasen[playerid] == 1){
- return 1;
- }
- return 0;
- }
- 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 == 1){
- format(stringX, 256, file, PlayerName(playerid));
- if(dini_Exists(stringX) == 1){
- new heslo[256];
- heslo = dini_Get(stringX,"Heslo");
- format(stringY, 256, "%s", heslo);
- if(strlen(inputtext) != 0){
- if(!strcmp(dini_Get(stringX,"Heslo"), inputtext)){
- prihlasen[playerid] = 1;
- }else{
- SCM(playerid, RED, "[#] Špatné heslo");
- ShowPlayerDialog(playerid,login,DIALOG_STYLE_INPUT,"Přihlášení","Vaše heslo:","Přihlásit","Storno");
- }
- }else{
- SCM(playerid, RED, "[#] Špatné heslo");
- ShowPlayerDialog(playerid,login,DIALOG_STYLE_INPUT,"Přihlášení","Vaše heslo:","Přihlásit","Storno");
- }
- }else{
- if(strlen(inputtext) != 0){
- dini_Create(stringX);
- format(stringY, 256, "%s", inputtext);
- dini_Set(stringX,"Heslo",stringY);
- dini_IntSet(stringX,"Povolani", 0);
- dini_IntSet(stringX,"ALevel", 0);
- dini_IntSet(stringX,"Penize", 0);
- prihlasen[playerid] = 1;
- }else{
- SCM(playerid, RED, "[#] Heslo nesmí zůstat prázdné");
- ShowPlayerDialog(playerid,0,DIALOG_STYLE_INPUT,"Registrace","Zaregistrujte se:","Registrovat","Kick");
- }
- }
- }else{
- Kick(playerid);
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- stock PlayerName(playerid)
- {
- new name[255];
- GetPlayerName(playerid, name, 255);
- return name;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement