Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=================================INCLUDEs===================================//
- #include <a_samp>
- #include <YSI\y_ini>
- #include <streamer>
- #include <YSI\y_commands>
- #include <YSI\y_master>
- //=============================BOJE===========================================//
- #define green 0x00DE28FF
- #define green2 0xAFFF00FF
- #define darkgreen 0x5FB700FF
- #define lightgreen 0x23FF00FF
- #define red 0xFF0000FF
- #define yellow 0xF5FF00FF
- #define darkyellow 0xF5DE00FF
- #define orange 0xF5A300FF
- #define darkblue 0x0037FFFF
- #define blue 0x009BFFFF
- #define lightblue 0x00FFF0FF
- #define grey 0xB4B4B4FF
- #define white 0xF0F0F0FF
- #define purple 0x9C00AFFF
- #define black 0x0000BBAA
- #define BELA "{FFFFFF}"
- #define CRVENA "{F81414}"
- #define ZUTA "{CCCC33}"
- //=============================PRAGMA TABSIZE=================================//
- #pragma tabsize 0
- //=================================NEWs=======================================//
- new Text:registracija1;
- new Text:registracija2;
- new Text:registracija3;
- new Text:registracija4;
- new Text:registracija5;
- new Text:registracija6;
- new Text:registracija7;
- new Text:registracija8;
- new Text:registracija9;
- //=====================
- new Text:teleportBox;
- new Text:teleportDM;
- new Text:teleportST;
- new Text:teleportVPG;
- //=================================DIALOGs====================================//
- #define DIALOG_REGISTER 1
- #define DIALOG_LOGIN 2
- //========================DEFINEovi SCM,SCMTA=================================//
- #define SCM SendClientMessage
- #define SCMTA SendClientMessageToAll
- //=================================PATHs======================================//
- #define PATH "/Korisnici/%s.ini"
- //=================================ENUMs======================================//
- enum pInfo
- {
- pRegistrovan,
- pLozinka,
- pNovac,
- pAdmin,
- pUbistva,
- pSmrti
- };
- new PlayerInfo[MAX_PLAYERS][pInfo];
- //=================================STOCKs=====================================//
- stock UserPath(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),PATH,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;
- }
- //=================================PUBLICs====================================//
- public OnGameModeInit()
- {
- SetGameModeText("RG GM - DM/Stunt");
- SendRconCommand("mapname RG City");
- //--------------------------------------------------------------
- registracija1 = TextDrawCreate(-4,0,"_");
- TextDrawLetterSize(registracija1,0.800000,11.700008);
- TextDrawAlignment(registracija1,0);
- TextDrawBackgroundColor(registracija1,0x000000FF);
- TextDrawFont(registracija1,3);
- TextDrawUseBox(registracija1,1);
- TextDrawBoxColor(registracija1,0x000000FF);
- TextDrawTextSize(registracija1,719.000000,31.000000);
- TextDrawSetOutline(registracija1,0);
- TextDrawSetProportional(registracija1,1);
- TextDrawSetShadow(registracija1,1);
- registracija2 = TextDrawCreate(3,342,"_");
- TextDrawLetterSize(registracija2,0.750000,11.800008);
- TextDrawAlignment(registracija2,0);
- TextDrawBackgroundColor(registracija2,0x000000FF);
- TextDrawFont(registracija2,3);
- TextDrawUseBox(registracija2,1);
- TextDrawBoxColor(registracija2,0x000000FF);
- TextDrawTextSize(registracija2,644.000000,350.000000);
- TextDrawSetOutline(registracija2,0);
- TextDrawSetProportional(registracija2,1);
- TextDrawSetShadow(registracija2,1);
- registracija3 = TextDrawCreate(6,46,"~r~~h~D~w~~h~obrodosli");
- TextDrawLetterSize(registracija3,0.550000,1.700000);
- TextDrawAlignment(registracija3,0);
- TextDrawBackgroundColor(registracija3,0x000000FF);
- TextDrawFont(registracija3,3);
- TextDrawUseBox(registracija3,0);
- TextDrawSetOutline(registracija3,1);
- TextDrawSetProportional(registracija3,1);
- TextDrawSetShadow(registracija3,1);
- registracija4 = TextDrawCreate(120,46,"~r~~h~N~w~~h~a");
- TextDrawLetterSize(registracija4,0.650000,1.700000);
- TextDrawAlignment(registracija4,0);
- TextDrawBackgroundColor(registracija4,0x000000FF);
- TextDrawFont(registracija4,3);
- TextDrawUseBox(registracija4,0);
- TextDrawSetOutline(registracija4,1);
- TextDrawSetProportional(registracija4,1);
- TextDrawSetShadow(registracija4,1);
- registracija5 = TextDrawCreate(147,70,"~r~~h~R~w~~h~adius ~r~~h~G~w~~h~aming");
- TextDrawLetterSize(registracija5,0.500000,1.700000);
- TextDrawAlignment(registracija5,0);
- TextDrawBackgroundColor(registracija5,0x000000FF);
- TextDrawFont(registracija5,3);
- TextDrawUseBox(registracija5,0);
- TextDrawSetOutline(registracija5,1);
- TextDrawSetProportional(registracija5,1);
- TextDrawSetShadow(registracija5,1);
- registracija6 = TextDrawCreate(227,84,"~r~~h~DM~w~~h~/~r~~h~FR");
- TextDrawLetterSize(registracija6,0.249999,0.899999);
- TextDrawAlignment(registracija6,0);
- TextDrawBackgroundColor(registracija6,0x000000FF);
- TextDrawFont(registracija6,1);
- TextDrawUseBox(registracija6,0);
- TextDrawSetOutline(registracija6,1);
- TextDrawSetProportional(registracija6,1);
- TextDrawSetShadow(registracija6,1);
- registracija7 = TextDrawCreate(237,428,"~r~~h~V~w~~h~lasnik : ~r~~h~C~w~~h~imbur");
- TextDrawLetterSize(registracija7,0.500000,2.100000);
- TextDrawAlignment(registracija7,0);
- TextDrawBackgroundColor(registracija7,0x000000FF);
- TextDrawFont(registracija7,3);
- TextDrawUseBox(registracija7,0);
- TextDrawSetOutline(registracija7,1);
- TextDrawSetProportional(registracija7,1);
- TextDrawSetShadow(registracija7,1);
- registracija8 = TextDrawCreate(249,402,"~r~~h~R~w~~h~egistracija");
- TextDrawLetterSize(registracija8,0.550000,1.800000);
- TextDrawAlignment(registracija8,0);
- TextDrawBackgroundColor(registracija8,0x000000FF);
- TextDrawFont(registracija8,3);
- TextDrawUseBox(registracija8,0);
- TextDrawSetOutline(registracija8,1);
- TextDrawSetProportional(registracija8,1);
- TextDrawSetShadow(registracija8,1);
- registracija9 = TextDrawCreate(249,452,"~r~~h~L~w~~h~ogin");
- TextDrawLetterSize(registracija9,0.550000,1.800000);
- TextDrawAlignment(registracija9,0);
- TextDrawBackgroundColor(registracija9,0x000000FF);
- TextDrawFont(registracija9,3);
- TextDrawUseBox(registracija9,0);
- TextDrawSetOutline(registracija9,1);
- TextDrawSetProportional(registracija9,1);
- TextDrawSetShadow(registracija9,1);
- //--------------------------------------------------------------
- teleportBox = TextDrawCreate(320.000000, 143.000000, "~n~Teleport menu~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~_");
- TextDrawAlignment(teleportBox, 2);
- TextDrawBackgroundColor(teleportBox, 255);
- TextDrawFont(teleportBox, 2);
- TextDrawLetterSize(teleportBox, 0.500000, 1.000000);
- TextDrawColor(teleportBox, -1);
- TextDrawSetOutline(teleportBox, 0);
- TextDrawSetProportional(teleportBox, 1);
- TextDrawSetShadow(teleportBox, 1);
- TextDrawUseBox(teleportBox, 1);
- TextDrawBoxColor(teleportBox, 255);
- TextDrawTextSize(teleportBox, 45.000000, 115.000000);
- teleportDM = TextDrawCreate(320.000000, 180.000000, "STUNT~n~Los Santos");
- TextDrawAlignment(teleportDM, 2);
- TextDrawBackgroundColor(teleportDM, 255);
- TextDrawFont(teleportDM, 2);
- TextDrawLetterSize(teleportDM, 0.260000, 0.799999);
- TextDrawColor(teleportDM, -1);
- TextDrawSetOutline(teleportDM, 0);
- TextDrawSetProportional(teleportDM, 1);
- TextDrawSetShadow(teleportDM, 1);
- teleportST = TextDrawCreate(320.000000, 205.000000, "DeathMatch~n~Los Santos");
- TextDrawAlignment(teleportST, 2);
- TextDrawBackgroundColor(teleportST, 255);
- TextDrawFont(teleportST, 2);
- TextDrawLetterSize(teleportST, 0.260000, 0.799999);
- TextDrawColor(teleportST, -1);
- TextDrawSetOutline(teleportST, 0);
- TextDrawSetProportional(teleportST, 1);
- TextDrawSetShadow(teleportST, 1);
- teleportVPG = TextDrawCreate(320.000000, 230.000000, "Voznja po gradu~n~Los Santos");
- TextDrawAlignment(teleportVPG, 2);
- TextDrawBackgroundColor(teleportVPG, 255);
- TextDrawFont(teleportVPG, 2);
- TextDrawLetterSize(teleportVPG, 0.260000, 0.799999);
- TextDrawColor(teleportVPG, -1);
- TextDrawSetOutline(teleportVPG, 0);
- TextDrawSetProportional(teleportVPG, 1);
- TextDrawSetShadow(teleportVPG, 1);
- //-----------------------------------------------
- TextDrawSetSelectable(teleportBox, false);
- TextDrawSetSelectable(teleportVPG, true);
- TextDrawSetSelectable(teleportST, true);
- TextDrawSetSelectable(teleportDM, true);
- return 1;
- }
- public OnGameModeExit()
- {
- TextDrawDestroy(teleportBox);
- TextDrawDestroy(teleportVPG);
- TextDrawDestroy(teleportST);
- TextDrawDestroy(teleportDM);
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- TextDrawShowForPlayer(playerid,registracija1);
- TextDrawShowForPlayer(playerid,registracija2);
- TextDrawShowForPlayer(playerid,registracija3);
- TextDrawShowForPlayer(playerid,registracija4);
- TextDrawShowForPlayer(playerid,registracija5);
- TextDrawShowForPlayer(playerid,registracija6);
- TextDrawShowForPlayer(playerid,registracija7);
- TextDrawShowForPlayer(playerid,registracija9);
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- new string[250];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(string,sizeof(string),"{FA0707}_______________________________\n\n{FAF2F7}Dobrodosao nazad {FA0707}%s, \n\n{FAF2F7}upisi lozinku ako zelis pristupiti\n{FA0707}R{FAF2F7}adius {FA0707}G{FAF2F7}aming {FA0707}S{FAF2F7}erver-u.\n\n{FA0707}_______________________________",name);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "PRIJAVLJIVANJE", string, "Uredu", "");
- }
- else
- {
- SetTimerEx("PokaziRegister", 2000, false, "i", playerid);
- }
- SetTimerEx("PokaziKameru", 1, false, "i", playerid);
- SetTimerEx("ObrisiChet", 1, false, "i", playerid);
- TogglePlayerSpectating(playerid, true);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Novac",GetPlayerMoney(playerid));
- INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
- INI_WriteInt(File,"Ubistva",PlayerInfo[playerid][pUbistva]);
- INI_WriteInt(File,"Smrti",PlayerInfo[playerid][pSmrti]);
- INI_Close(File);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- TextDrawHideForPlayer(playerid,registracija1);
- TextDrawHideForPlayer(playerid,registracija2);
- TextDrawHideForPlayer(playerid,registracija3);
- TextDrawHideForPlayer(playerid,registracija4);
- TextDrawHideForPlayer(playerid,registracija5);
- TextDrawHideForPlayer(playerid,registracija6);
- TextDrawHideForPlayer(playerid,registracija7);
- TextDrawHideForPlayer(playerid,registracija8);
- TextDrawHideForPlayer(playerid,registracija9);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- PlayerInfo[killerid][pUbistva]++;
- PlayerInfo[playerid][pSmrti]++;
- 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 OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- if(_:clickedid != INVALID_TEXT_DRAW)
- {
- if(clickedid == teleportDM)
- {
- SetPlayerPos(playerid, 1630.2030,-2328.9673,13.5469);
- SetPlayerFacingAngle(playerid, 0.9392);
- }
- else if(clickedid == teleportST)
- {
- SetPlayerPos(playerid, -1424.6083, -290.9622, 14.1484);
- SetPlayerFacingAngle(playerid, 134.9570);
- }
- else if(clickedid == teleportVPG)
- {
- SetPlayerPos(playerid, 1688.7990, 1447.7753, 10.7675);
- SetPlayerFacingAngle(playerid, 267.3902);
- }
- TextDrawHideForPlayer(playerid, teleportBox);
- TextDrawHideForPlayer(playerid, teleportDM);
- TextDrawHideForPlayer(playerid, teleportST);
- TextDrawHideForPlayer(playerid, teleportVPG);
- CancelSelectTextDraw(playerid);
- }
- 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_REGISTER, DIALOG_STYLE_INPUT, "Registracija","Ukucali ste pogresnu lozinku.\nUkucajte ispravnu lozinku da bi se registrovali.","Registruj se","Izadji");
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Lozinka",udb_hash(inputtext));
- INI_WriteInt(File,"Novac",0);
- INI_WriteInt(File,"Admin",0);
- INI_WriteInt(File,"Ubistva",0);
- INI_WriteInt(File,"Smrti",0);
- INI_Close(File);
- TogglePlayerSpectating(playerid, false);
- SetSpawnInfo(playerid, 0, 29, 1958.33, 1343.12, 15.36, 269.15, 1, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- GivePlayerMoney(playerid, 5000);
- SendClientMessage(playerid, -1, "Dobrodosli na Radius Gaming DM/FR Server, nadamo se da cete uzivati.");
- }
- }
- case DIALOG_LOGIN:
- {
- if(!response) return Kick(playerid);
- if(response)
- {
- if(udb_hash(inputtext) == PlayerInfo[playerid][pLozinka])
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- TogglePlayerSpectating(playerid, false);
- SetSpawnInfo(playerid, 0, 29, 1958.33, 1343.12, 15.36, 269.15, 1, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- GivePlayerMoney(playerid, PlayerInfo[playerid][pNovac]);
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Prijavljivanje","Ukucali ste pogresnu lozinku.\nUkucajte ispravnu lozinku da bi se ulogovali.","Prijavi se","Izadji");
- }
- return 1;
- }
- }
- }
- return 1;
- }
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- INI_Int("Lozinka",PlayerInfo[playerid][pLozinka]);
- INI_Int("Novac",PlayerInfo[playerid][pNovac]);
- INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
- INI_Int("Ubistva",PlayerInfo[playerid][pUbistva]);
- INI_Int("Smrti",PlayerInfo[playerid][pSmrti]);
- return 1;
- }
- forward PokaziRegister(playerid);
- public PokaziRegister(playerid)
- {
- TextDrawShowForPlayer(playerid,registracija1);
- TextDrawShowForPlayer(playerid,registracija2);
- TextDrawShowForPlayer(playerid,registracija3);
- TextDrawShowForPlayer(playerid,registracija4);
- TextDrawShowForPlayer(playerid,registracija5);
- TextDrawShowForPlayer(playerid,registracija6);
- TextDrawShowForPlayer(playerid,registracija7);
- TextDrawShowForPlayer(playerid,registracija8);
- new string[250];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(string,sizeof(string),"{FA0707}_______________________________\n\n{FAF2F7}Dobrodosao {FA0707}%s, \n\n{FAF2F7}upisi lozinku ako zelis pristupiti\n{FA0707}R{FAF2F7}adius {FA0707}G{FAF2F7}aming {FA0707}S{FAF2F7}erver-u.\n\n{FA0707}_______________________________",name);
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "REGISTRACIJA", string, "Uredu", "");
- return 1;
- }
- forward ObrisiChet(playerid);
- public ObrisiChet(playerid)
- {
- for(new i = 0; i < 200; i++)
- {
- SendClientMessage(playerid, -1, " ");
- }
- return 1;
- }
- forward PokaziKameru(playerid);
- public PokaziKameru(playerid)
- {
- InterpolateCameraPos(playerid, 1713.581176, -2517.539306, 31.030027, 1774.834594, -2484.041503, 31.030027, 4000);
- InterpolateCameraLookAt(playerid, 1708.947998, -2519.105957, 29.991094, 1770.360229, -2481.818847, 30.831178, 2000);
- return 1;
- }
- main(){}
- //===============================KOMANDE======================================//
- YCMD:teleport(playerid, params[], help)
- {
- #pragma unused help
- #pragma unused params
- TextDrawShowForPlayer(playerid, teleportBox);
- TextDrawShowForPlayer(playerid, teleportDM);
- TextDrawShowForPlayer(playerid, teleportST);
- TextDrawShowForPlayer(playerid, teleportVPG);
- SelectTextDraw(playerid, 0xA3B4C5FF);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment