Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*============================================================================\\
- //===================Bacado Gaming============================================\\
- //===================Mod je radjen od 0=======================================\\
- //===================Skripter:PazzOnee========================================\\
- //===================Maper:PazzOnee===========================================\\
- //============================================================================*/
- #pragma tabsize 0
- #include <a_samp>
- #include <YSI\y_ini>
- #include <YSI\y_commands>
- #include < float >
- #include <sscanf2>
- #include < streamer >
- #define DIALOG_REGISTER 1
- #define DIALOG_LOGIN 2
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 50
- /////////BOJE///////////////////////
- #define BELA "{FFFFFF}"
- #define ZELENA "{6EF83C}"
- #define CRVENA "{F81414}"
- #define PLAVA "{2E9CD1}"
- #define ORANGE "{FF9500}"
- #define ZLATNA "{FFC50A}"
- #define SERVER "{AFE7FF}"
- #define SZELENA "{C9FFAB}"
- #define LJUB "{EE11EE}"
- #define SIVA "{C0C0C0}"
- #define NALOZI "/Nalozi/%s.ini"
- enum pInfo
- {
- pLozinka,
- pDzepNovac,
- pBankaNovac,
- pAdmin,
- pLevel
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- new IgracUlogovan[MAX_PLAYERS];
- ///////////////////////////////////////////////////////
- forward UcitajKorisnika_data(playerid,name[],value[]);
- public UcitajKorisnika_data(playerid,name[],value[])
- {
- INI_Int("Lozinka",PlayerInfo[playerid][pLozinka]);
- INI_Int("DzepNovac",PlayerInfo[playerid][pDzepNovac]);
- INI_Int("BankaNovac",PlayerInfo[playerid][pBankaNovac]);
- INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
- INI_Int("Level",PlayerInfo[playerid][pLevel]);
- return 1;
- }
- stock SacuvajKorisnika(playerid)
- {
- if(IgracUlogovan[playerid] == 1)
- {
- new INI:File = INI_Open(Korisnici(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"DzepNovac",PlayerInfo[playerid][pDzepNovac]);
- INI_WriteInt(File,"BankaNovac",PlayerInfo[playerid][pBankaNovac]);
- INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
- INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
- INI_Close(File);
- }
- return 1;
- }
- stock KorisnickiRacun(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),NALOZI,playername);
- return string;
- }
- stock udb_hash(buf[])
- {
- new length=strlen(buf);
- new s1 = 1;
- new s2 = 0;
- new n;
- for (n=0; n<length; n++)
- {
- s1 = (s1 + buf[n]) % 65521;
- s2 = (s2 + s1) % 65521;
- }
- return (s2 << 16) + s1;
- }
- main()
- {
- print("\n----------------------------------");
- print(" Bacado Gaming RolePlay v0.1 ");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- SetGameModeText("Bacado Gaming");
- 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)
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- IgracUlogovan[playerid] = 0;
- /////////////////////////////////////
- if(fexist(KorisnickiRacun(playerid)))
- {
- INI_ParseFile(KorisnickiRacun(playerid),"UcitajKorisnika_%s",.bExtra = true,.extra = playerid);
- ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"LOGIN:","Unesite vasu lozinku da biste se ulogovali!","Login","Izlaz");
- }
- else
- {
- ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register:",""ZELENA"Vas nalog ne postoji, molimo registrujte se!","Register","Izlaz");
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new INI:File = INI_Open(KorisnickiRacun(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"DzepNovac",GetPlayerMoney(playerid));
- INI_WriteInt(File,"BankaNovac",PlayerInfo[playerid][pBankaNovac]);
- INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
- INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
- INI_Close(File);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerHealth(playerid, 100);
- 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 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[])
- {
- switch(dialogid)
- {
- case DIALOG_REGISTER:
- {
- if(!response) return Kick(playerid);
- if(response)
- {
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"LOGIN:","Netacna lozinka!","Login","Izlaz");
- new INI:File = INI_Open(KorisnickiRacun(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Lozinka",udb_hash(inputtext));
- INI_WriteInt(File,"DzepNovac",0);
- INI_WriteInt(File,"BankaNovac",0);
- INI_WriteInt(File,"Admin",0);
- INI_WriteInt(File,"Level",0);
- INI_Close(File);
- SetPlayerSkin(playerid,294);
- SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- }
- }
- case DIALOG_LOGIN:
- {
- if(!response) return Kick(playerid);
- if(response)
- {
- if(udb_hash(inputtext) == PlayerInfo[playerid][pLozinka])
- {
- INI_ParseFile(KorisnickiRacun(playerid),"UcitajKorisnika_%s",.bExtra = true,.extra = playerid);
- SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
- SetPlayerSkin(playerid,294);
- SpawnPlayer(playerid);
- GivePlayerMoney(playerid,PlayerInfo[playerid][pDzepNovac]);
- SetPlayerScore(playerid,PlayerInfo[playerid][pLevel]);
- SendClientMessage(playerid,-1,""ZELENA"Dobrodosao nazad na server, zelimo ti ugodnu igru!");
- }
- else
- {
- ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"LOGIN:","Lozinka nije ispravna!",""ZELENA"Login",""CRVENA"Izlaz");
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerCommandPerformed(playerid,cmdtext[],success)
- {
- if(!success) SendClientMessage(playerid,-1,""CRVENA"[Komanda ne postoji, postojace komande mozes videti na /help!]");
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- /////////////////////////////////////////
- YCMD:fv(playerid,params[],help)
- {
- #pragma unused params
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,-1, ""ZELENA"| BGaming | "CRVENA"Niste u vozilu!");
- RepairVehicle(GetPlayerVehicleID(playerid));
- SendClientMessage(playerid,-1,""ZELENA"| BGaming |"CRVENA" Vozilo Popravljeno!");
- return 1;
- }
- YCMD:flip(playerid, params[], help)
- {
- new VehicleID, Float:CX, Float:CY, Float:CZ, Float:CA;
- GetPlayerPos(playerid, CX, CY, CZ);
- VehicleID = GetPlayerVehicleID(playerid);
- SetVehiclePos(VehicleID, CX, CY, CZ);
- GetVehicleZAngle(VehicleID, CA);
- SetVehicleZAngle(VehicleID, CA);
- RepairVehicle(GetPlayerVehicleID(playerid));
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement