Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //============================================================================//
- //============================================================================//
- //============================================================================//
- //============================================================================//
- // MOJ PRVI GAMEMOD OD 0 //
- // SKRIPTER : NENAC //
- // MAPER : NEDAC //
- // ZASLUGE : BS-FORUM //
- // ZBSAMP-FORMU //
- //============================================================================//
- //============================================================================//
- //============================================================================//
- //============================================================================//
- #include <a_samp>
- #include <YSI\y_ini>
- #include <YSI\y_commands>
- #include <sscanf2>
- #include <streamer>
- #include <foreach>
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 50
- #define MAX_ORGANIZACIJA 7
- #define SACUVAJ_IGRACA "Igraci/%s.ini"
- #define DIALOG_PRIJAVA 1
- #define DIALOG_REGISTRACIJA 2
- #define DIALOG_SPOL 3
- #define DIALOG_GODINE 4
- #define DIALOG_EMAIL 5
- #define DIALOG_DRZAVA 6
- #define IMESERVERA "4-GAME ROLEPLAY"
- #define VERZIJAMODA "Beta"
- #define MAPASERVERA "Los Santos"
- #define STRANICASERVERA "www.izradi.com"
- #define SERVER_SKRACENICA "4-GAME RPG"
- #define SCM SendClientMessage
- #define SPD ShowPlayerDialog
- new
- ServerStartCount;
- //=============================ENUM's===========================================
- enum pInfo
- {
- pPass[100],
- pSpol,
- pGodine,
- pEmail,
- pDrzava
- };
- new PlayerInfo[MAX_PLAYERS][pInfo];
- main()
- {
- print("\n----------------------------------");
- print(" "IMESERVERA"");
- printf("Server je ucitan za %dms", GetTickCount()-ServerStartCount);
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- ServerStartCount = GetTickCount();
- SetGameModeText(VERZIJAMODA);
- SendRconCommand("mapname "MAPASERVERA"");
- SendRconCommand("hostname "IMESERVERA"");
- SendRconCommand("weburl "STRANICASERVERA"");
- 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)
- {
- 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)
- {
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- SPD(playerid, DIALOG_PRIJAVA, DIALOG_STYLE_INPUT,"Login","Upisite lozinku za da se logujete.","Login","Nazad");
- }
- else
- {
- SPD(playerid, DIALOG_REGISTRACIJA, DIALOG_STYLE_INPUT,"Registracija.","Upisite lozinku da se registrujete.","Register","Quit");
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Spol",PlayerInfo[playerid][pSpol]);
- INI_WriteInt(File,"Godine",PlayerInfo[playerid][pGodine]);
- INI_Close(File);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- 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[])
- {
- 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 == DIALOG_REGISTRACIJA)
- {
- if (!response) return Kick(playerid);
- if(response)
- {
- if(!strlen(inputtext)) return SPD(playerid, DIALOG_REGISTRACIJA, DIALOG_STYLE_PASSWORD, "Registriranje...","Vnesovte pogresna lozinka.\nVnesete lozinka da se registrirate.","Register","Quit");
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteString(File,"Password", inputtext);
- INI_Close(File);
- SPD(playerid, DIALOG_SPOL, DIALOG_STYLE_MSGBOX,"Informacije","Koji ste spol?.","Musko","Zensko");
- }
- }
- if(dialogid == DIALOG_PRIJAVA)
- {
- if(!response) return Kick(playerid);
- if(response)
- {
- if(!strcmp(inputtext, PlayerInfo[playerid][pPass], false))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- SpawnPlayer(playerid);
- }
- else
- {
- SPD(playerid, DIALOG_PRIJAVA, DIALOG_STYLE_PASSWORD,"Login","Unesena lozinka netacna.\nUnesite tacnu za logiranje.","Login","Quit");
- }
- }
- }
- if(dialogid == DIALOG_SPOL)
- {
- if(!response)
- {
- PlayerInfo[playerid][pSpol] = 2;
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Spol", 2);
- INI_Close(File);
- SPD(playerid, DIALOG_GODINE, DIALOG_STYLE_INPUT, "Godine", "Koliko imate godina??", "Dalje", "Izlaz");
- }
- if(response)
- {
- PlayerInfo[playerid][pSpol] = 1;
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Spol", 1);
- INI_Close(File);
- SPD(playerid, DIALOG_GODINE, DIALOG_STYLE_INPUT, "Godine", "Koliko imate godina??", "Dalje", "Izlaz");
- }
- }
- if(dialogid == DIALOG_GODINE)
- {
- if(response)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteString(File, "Godine", inputtext);
- INI_Close(File);
- // SetSpawnInfo(playerid, 0, 0, 1219.4819,-1813.7813,16.5938,89.5090, 0, 0, 0, 0, 0, 0 );
- // SpawnPlayer(playerid);
- SPD(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Email", "Unesite vašu Email adresu", "Dalje", "Izlaz");
- }
- if(!response)
- {
- Kick(playerid);
- }
- }
- if(dialogid == DIALOG_EMAIL)
- {
- if(response)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteString(File, "Email", inputtext);
- INI_Close(File);
- SPD(playerid, DIALOG_DRZAVA, DIALOG_STYLE_INPUT, "Drzava", "Unesite ime državu iz koje dolazite", "Dalje", "Izlaz");
- }
- if(!response)
- {
- Kick(playerid);
- }
- }
- if(dialogid == DIALOG_DRZAVA)
- {
- if(response)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteString(File, "Drzava", inputtext);
- INI_Close(File);
- SetSpawnInfo(playerid, 0, 0, 1219.4819,-1813.7813,16.5938,89.5090, 0, 0, 0, 0, 0, 0 );
- SpawnPlayer(playerid);
- }
- if(!response)
- {
- Kick(playerid);
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- stock UserPath(playerid)
- {
- new string[128], playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, sizeof(playername));
- format(string, sizeof(string), SACUVAJ_IGRACA, playername);
- return string;
- }
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- INI_String("Password", PlayerInfo[playerid][pPass], 100);
- INI_Int("Spol", PlayerInfo[playerid][pSpol]);
- INI_Int("Godine", PlayerInfo[playerid][pGodine]);
- INI_Int("Email", PlayerInfo[playerid][pEmail]);
- INI_Int("Država", PlayerInfo[playerid][pDrzava]);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment