Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- |WRT|WaRaT v1.0.0. by Snimpe
- RP GAME MODE
- *********
- *Komande*
- *********
- RCON
- ----
- /smash-dok je u vozilo ono skroz smrvi, unisti i razlupa vozilo
- /makeleader-postavi lidera
- /hesoyam-250000$, 100HP, 100Armour, auto nov
- /veh-stvara vozila
- /makeadmin-treba napraviti
- */
- //==============================================================================
- //==============================================================================
- //==============================================================================
- #include <a_samp>
- #include <YSI\y_ini>
- #include <sscanf2>
- #include <ZCMD>
- #include <foreach>
- #define SCM SendClientMessage
- #define DIALOG_REGISTER 1
- #define DIALOG_LOGIN 2
- #define DIALOG_SUCCESS_1 3
- #define DIALOG_SUCCESS_2 4
- #define DIALOG_ORG_INVITE 5
- #define PATH "/Users/%s.ini"
- #define COLOR_ORANGE "{FF6600}"
- #define COL_WHITE "{FFFFFF}"
- #define COL_RED "{F81414}"
- #define COL_GREEN "{00FF22}"
- #define COL_LIGHTBLUE "{00CED1}"
- #define COLOR_BLUE 0x2711F2
- #define COLOR_GREY 0xAFAFAFAA
- #define C_WHITE 0xFFFFFFAA
- #define MAX_ORGS 1
- //==============================================================================
- new KillMinutniTimer;
- new OOC = 0;
- new gPoliceCar[1]; // 2 je broj koliko ima policijskih vozila, ako zelite dodavat jos vozila LSPD organizaciji (ili nekoj novoj organizaciji), taj broj mora biti jednak broju vozila te org.
- //==============================================================================
- enum pInfo
- {
- pPass,
- pCash,
- pLevel,
- pRespekti,
- pPayPoeni,
- pAdmin,
- pKills,
- pDeaths,
- pLider,
- pClan,
- pRank,
- pSkin,
- pOrg_Skin
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- //==============================================================================
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- INI_Int("Password",PlayerInfo[playerid][pPass]);
- INI_Int("Cash",PlayerInfo[playerid][pCash]);
- INI_Int("Level",PlayerInfo[playerid][pOrg_Skin]);
- INI_Int("Respekti",PlayerInfo[playerid][pOrg_Skin]);
- INI_Int("PayDayPoeni",PlayerInfo[playerid][pOrg_Skin]);
- INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
- INI_Int("Kills",PlayerInfo[playerid][pKills]);
- INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
- INI_Int("Lider",PlayerInfo[playerid][pLider]);
- INI_Int("Clan",PlayerInfo[playerid][pClan]);
- INI_Int("Rank",PlayerInfo[playerid][pRank]);
- INI_Int("Skin",PlayerInfo[playerid][pSkin]);
- INI_Int("Org Skin",PlayerInfo[playerid][pOrg_Skin]);
- return 1;
- }
- //==============================================================================
- stock UserPath(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),PATH,playername);
- return string;
- }
- /*COL_REDits to Dracoblue*/
- 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(" |WRT| v1.0.0");
- print("\n************************************");
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- public OnGameModeInit()
- {
- SetGameModeText("|WRT| v1.0.0");
- KillMinutniTimer = SetTimer("MinutniTimer", 1000, 1);//jedna minuta
- gPoliceCar[0] = AddStaticVehicleEx(597, 1594.9362, -1679.0898, 5.8210, 0.0000, -1, -1, 100); // Stvara vozilo LSPD-a i pamti njegov ID u varijabli gPoliceCar[0]
- return 1;
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- public OnGameModeExit()
- {
- KillTimer(KillMinutniTimer);//uništava timer
- return 1;
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- public OnPlayerRequestClass(playerid, classid)
- {
- SetSpawnInfo(playerid, 0, 0,1544.5767,-1373.3291,329.7563,179.8415,46,1,0,0,0,0); //
- SpawnPlayer(playerid);
- return 1;
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- public OnPlayerConnect(playerid)
- {
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
- }
- return 1;
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- public OnPlayerDisconnect(playerid, reason)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
- INI_WriteInt(File,"Level",PlayerInfo[playerid][pOrg_Skin]);
- INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
- INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
- INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
- INI_WriteInt(File,"Lider",PlayerInfo[playerid][pLider]);
- INI_Close(File);
- return 1;
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- public OnPlayerSpawn(playerid)
- {
- GivePlayerWeapon(playerid, 46, 1);
- if (PlayerInfo[playerid][pClan] > 0)
- {
- switch(PlayerInfo[playerid][pClan])
- {
- case 1: // Prva organizacija, nazovimo je Los Santos Police Department
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); // Postavlja igracevu poziciju na te koordinate, vi te koordinate mozete zamijeniti svojima
- SetPlayerFacingAngle(playerid, 270.1425); // Postavlja kamo da igrac gleda, vi to mozete zamijeniti sa svojim kutem
- SetPlayerSkin(playerid, PlayerInfo[playerid][pOrg_Skin]); // Postavlja igracev skin na onaj koji mora imat dok je u organizaciji
- }
- // Ovaj kod ispod kao da ne postoji, ali vam prikazuje kako dodati jos jednu organizaciju za spawn, sto je potrebno svaki put kada zelite dodati novu organizaciju
- /*case 2: // Druga organizacije, nazovimo je FBI
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); // Postavlja igracevu poziciju na te koordinate, vi te koordinate mozete zamijeniti svojima
- SetPlayerFacingAngle(playerid, 270.1425); // Postavlja kamo da igrac gleda, vi to mozete zamijeniti sa svojim kutem
- SetPlayerSkin(playerid, PlayerInfo[playerid][pOrg_Skin]); // Postavlja igracev skin na onaj koji mora imat dok je u organizaciji
- }*/
- }
- }
- else
- {
- SetPlayerPos(playerid, 1544.5767, -1373.3291, 329.7563);
- SetPlayerFacingAngle(playerid, 179.8415);
- }
- return 1;
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- public OnPlayerDeath(playerid, killerid, reason)
- {
- PlayerInfo[killerid][pKills]++;
- PlayerInfo[playerid][pDeaths]++;
- return 1;
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- public OnPlayerText(playerid, text[])
- {
- new LoseRijeci[][] =
- {
- {"kurac"},
- {"qrac"},
- {"racku"},
- {"racq"},
- {"jebem"},
- {"picka"}
- }
- ;
- for(new i; i != sizeof(LoseRijeci); ++i)
- {
- AntiPsovka(text, LoseRijeci[i]);
- }
- return 1;
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- return SendClientMessage(playerid, 0xAA3333AA, "ERROR: " "Komanda koju ste uneli ne postoji!");
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if (newstate == PLAYER_STATE_DRIVER) // Ako je usao u vozilo kao vozac
- {
- new
- iVehicleID = GetPlayerVehicleID(playerid);
- // Provjerava da li je igrac usao u vozilo org. LSPD i provjerava da li je clan te org., ako nije izbacit ce ga iz vozila
- if (IsAPoliceCar(iVehicleID) && (PlayerInfo[playerid][pClan] != 1 || PlayerInfo[playerid][pLider] != 1))
- {
- SendClientMessage(playerid, C_WHITE, "ERROR: Nisi clan Los Santos Police Departmenta.");
- RemovePlayerFromVehicle(playerid);
- }
- }
- return 1;
- }
- //==============================================================================
- stock IsAPoliceCar(iVehicleID) // By Joey_
- {
- for(new iIdx = 0; iIdx < sizeof(gPoliceCar); iIdx++)
- {
- if (gPoliceCar[iIdx] == iVehicleID)
- return 1;
- }
- return 0;
- }
- //==============================================================================
- stock PayDayPlata(playerid)
- {
- new SljedeciLvl, string[128];
- PlayerInfo[playerid][pRespekti] ++;//dodaje igracu jedan respekt
- if(PlayerInfo[playerid][pPayPoeni] >= 30)//ako igrac ima više od 30 pay poena vraca mu ih na 0
- {
- PlayerInfo[playerid][pPayPoeni] = 0;//stavlja igracu pay poene na 0
- }
- SljedeciLvl = 3 * PlayerInfo[playerid][pLevel] + 1;
- if(PlayerInfo[playerid][pRespekti] >= SljedeciLvl)//ako igrac ima više respekta od zadanog iznad
- {
- PlayerInfo[playerid][pLevel] ++;//dodaje igracu level+
- PlayerInfo[playerid][pRespekti] = 0;//vraca igracu respekte na 0
- SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);//postavlja igracu level
- format(string,sizeof(string),"Cestitamo, presli ste na level %i!", PlayerInfo[playerid][pLevel]);
- SendClientMessage(playerid, -1, string);//šalje igracu poruku
- }
- new osnova = 0, iznosplace = 0; osnova = 55 + random(99); iznosplace = osnova*PlayerInfo[playerid][pLevel];//ovo je za pare, to valjda znate necu objašnjavati
- format(string,sizeof(string),"Iznos vase plate je: %i", iznosplace);
- SendClientMessage(playerid, -1, string);//šalje igracu poruku
- return 1;
- }
- //==============================================================================
- forward MinutniTimer();
- public MinutniTimer()
- {
- for(new playerid = 0;playerid < GetMaxPlayers();playerid++)
- {
- PlayerInfo[playerid][pPayPoeni] ++; //277
- if(PlayerInfo[playerid][pPayPoeni] >= 30)
- {
- PayDayPlata(playerid);
- }
- }
- 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_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Password",udb_hash(inputtext));
- INI_WriteInt(File,"Cash",0);
- INI_WriteInt(File,"Level",0);
- INI_WriteInt(File,"Respekti",0);
- INI_WriteInt(File,"PayDayPoeni",0);
- INI_WriteInt(File,"Admin",0);
- INI_WriteInt(File,"Kills",0);
- INI_WriteInt(File,"Deaths",0);
- INI_Close(File);
- SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 46, 1, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
- }
- }
- case DIALOG_LOGIN:
- {
- if ( !response ) return Kick ( playerid );
- if( response )
- {
- if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
- ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
- }
- return 1;
- }
- }
- case DIALOG_ORG_INVITE: // Ovdje ce se izvrsiti daljnji kod nakon sto je igrac pritisnuo 'Prihvacam' ili 'Ne prihvacam'
- {
- if (response) // Ako je igrac pritisnuo 'Prihvacam'
- {
- switch(PlayerInfo[playerid][pClan])
- {
- case 1: // Prva organizacija, nazovimo je Los Santos Police Department
- {
- SetPlayerSkin(playerid, 280); // Broj 280 je ID skina za rank 1 u organizaciji LSPD, vi to mozete promijeniti na bilo koji ID skina koji vama odgovara
- SendClientMessage(playerid, C_WHITE, "INFO: Prihvatili ste poziv za ulazak u "COL_RED"Los Santos Police Department");
- }
- }
- }
- else // Ako je igrac pritisnuo 'Ne prihvacam'
- {
- // Resetiramo igraceve varijable na 0 jer nije prihvatio ulazak u organizaciju
- PlayerInfo[playerid][pClan] = 0;
- PlayerInfo[playerid][pRank] = 0;
- SendClientMessage(playerid, C_WHITE, "INFO: Odbili ste poziv za ulazak u organizaciju");
- }
- }
- }
- //=========================================================
- //=========================================================
- return 1;
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- forward SendAdminMessage(color, string[]);
- public SendAdminMessage(color, string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(PlayerInfo[i][pAdmin] >= 1)
- {
- SCM(i, color, string);
- }
- }
- }
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- forward Glad();
- public Glad()
- {
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- new Float:HP;
- GetPlayerHealth(i, HP);
- SetPlayerHealth(i, HP-3);
- }
- return 1;
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- stock AntiPsovka(string[], LoseRijeci[], zamjeni = '*')
- {
- new i;
- while((i = strfind(string, LoseRijeci, true)) != -1)
- {
- for(new x = (i + strlen(LoseRijeci)); i != x; ++i)
- {
- string[i] = zamjeni;
- }
- }
- return 1;
- }
- //==============================================================================
- //==============================================================================
- CMD:makeleader(playerid, params[])
- {
- if (IsPlayerAdmin(playerid)) // Provjerava da li je igrac RCON admin, vi to mozete promijeniti u svoju provjeru
- {
- new
- iPlayerID,
- iOrgID,
- szPlayerName[MAX_PLAYER_NAME],
- szMessage[105];
- if (sscanf(params, "ud", iPlayerID, iOrgID)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
- return SendClientMessage(playerid, C_WHITE, "KORISTI: /makeleader [igracev ID/dio imena] [ID organizacije]");
- else if (iPlayerID == INVALID_PLAYER_ID) // Ako je ID igraca koji je igrac upisao nije online, ispisuje mu tu poruku
- return SendClientMessage(playerid, C_WHITE, "ERROR: Pogresan ID igraca.");
- else if (iOrgID < 1 || iOrgID > MAX_ORGS) // Ako je ID organizacije koju je igrac upisao manja od 1 ili veca maksimalnog broja organizacija, ispisuje mu tu poruku
- return SendClientMessage(playerid, C_WHITE, "ERROR: ID organizacije ne smije biti manji od 1 ili veci od "#MAX_ORGS);
- PlayerInfo[iPlayerID][pLider] = iOrgID; // Postavlja igracevu varijablu za lidera na ID organizacije, jer moramo negdje zapamtit koje organizacije je igrac lider
- PlayerInfo[iPlayerID][pRank] = 6; // Postavlja igracevu varijablu za rank na 6, to vi mozete promijeniti ako ne zelite da vam je najveci rank 6
- switch(iOrgID)
- {
- case 1: // Prva organizacija, nazovimo je Los Santos Police Department
- {
- PlayerInfo[iPlayerID][pSkin] = GetPlayerSkin(iPlayerID); // Sprema igracev skin tako da ako ikad bude izbacen iz organizacije, dobija svoj stari skin natrag
- PlayerInfo[iPlayerID][pOrg_Skin] = 283; // Broj 283 je ID skina lidera organizacije, to mozete promijeniti u koji kod skin ID vi zelite
- SetPlayerSkin(iPlayerID, PlayerInfo[iPlayerID][pOrg_Skin]); // Postavlja igracu skin za lidera organizacije
- }
- // Ovaj kod ispod kao da ne postoji, ali vam prikazuje kako dodati jos jednu organizaciju u /makeleader komandu, sto je potrebno svaki put kada zelite dodati novu organizaciju
- /*case 2: // Druga organizacije, nazovimo je FBI
- {
- PlayerInfo[iPlayerID][pSkin] = GetPlayerSkin(iPlayerID); // Sprema igracev skin tako da ako ikad bude izbacen iz organizacije, dobija svoj stari skin natrag
- PlayerInfo[iPlayerID][pOrg_Skin] = 283; // Broj 283 je ID skina lidera organizacije, to mozete promijeniti u koji kod skin ID vi zelite
- SetPlayerSkin(iPlayerID, PlayerInfo[iPlayerID][pOrg_Skin]); // Postavlja igracu skin za lidera organizacije
- }*/
- }
- GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
- format(szMessage, sizeof(szMessage), "INFO: Admin %s vas je postavio za lidera organizacije %s", szPlayerName, GetOrgNameByID(iOrgID));
- SendClientMessage(iPlayerID, C_WHITE, szMessage);
- GetPlayerName(iPlayerID, szPlayerName, MAX_PLAYER_NAME);
- format(szMessage, sizeof(szMessage), "INFO: Postavio si igraca %s za lidera organizacije %s", szPlayerName, GetOrgNameByID(iOrgID));
- SendClientMessage(playerid, C_WHITE, szMessage);
- }
- else
- SendClientMessage(playerid, C_WHITE, "ERROR: Moras biti RCON admin da koristis ovu komandu.");
- return 1;
- }
- stock GetOrgNameByID(iOrgID) // By Joey_
- {
- new
- szOrgName[29];
- switch(iOrgID)
- {
- case 1: // Prva organizacija, nazovimo je Los Santos Police Department
- szOrgName = "Los Santos Police Department";
- default: // Ako ne postoji ID takve organizacije
- szOrgName = "Nepoznata organizacija";
- }
- return szOrgName;
- }
- //==============================================================================
- //==============================================================================
- CMD:invite(playerid, params[])
- {
- if (PlayerInfo[playerid][pLider] > 0) // Provjerava da li je igrac lider icega
- {
- new
- iPlayerID,
- szPlayerName[MAX_PLAYER_NAME],
- szInviteMsg[241];
- if (sscanf(params, "u", iPlayerID)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
- return SendClientMessage(playerid, C_WHITE, "KORISTI: /invite [igracev ID/dio imena]");
- else if (iPlayerID == INVALID_PLAYER_ID) // Ako je ID igraca koji je igrac upisao nije online, ispisuje mu tu poruku
- return SendClientMessage(playerid, C_WHITE, "ERROR: Pogresan ID igraca.");
- GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
- switch(PlayerInfo[playerid][pLider])
- {
- case 1: // Prva organizacija, nazovimo je Los Santos Police Department
- {
- PlayerInfo[iPlayerID][pClan] = PlayerInfo[playerid][pLider]; // Ovdje postavljamo igracu kojeg zelimo pozvati u organizaciju varijablu na ID organizacije (tako da kasnije znamo u kojoj je organizaciji)
- PlayerInfo[iPlayerID][pRank] = 1; // Postavlja igracu kojeg zelimo pozvati u organizaciju rank na 1
- // Ovdje formatiramo poruku koju cemo poslati igracu koji je pozvan u organizaciju
- // Preko te poruke ce pozvani igrac prihvatiti ili ne prihvatiti ulazak u organizaciju
- format(szInviteMsg, sizeof(szInviteMsg), "Lider %s vas je pozvao u organizaciju Los Santos Police Department.\n\nPritisnite tipku 'Prihvacam' ako zelite prihvatiti poziv za ulazak u tu organizaciju\nili pritisnite tipku 'Odbijam' ako ne zelite prihvatiti.", szPlayerName);
- }
- // Ovaj kod ispod kao da ne postoji, ali vam prikazuje kako dodati jos jednu organizaciju u /invite komandu, sto je potrebno svaki put kada zelite dodati novu organizaciju
- /*case 2: // Druga organizacije, nazovimo je FBI
- {
- PlayerInfo[iPlayerID][pClan] = PlayerInfo[playerid][pLider]; // Ovdje postavljamo igracu kojeg zelimo pozvati u organizaciju varijablu na ID organizacije (tako da kasnije znamo u kojoj je organizaciji)
- PlayerInfo[iPlayerID][pRank] = 1; // Postavlja igracu kojeg zelimo pozvati u organizaciju rank na 1
- // Ovdje formatiramo poruku koju cemo poslati igracu koji je pozvan u organizaciju
- // Preko te poruke ce pozvani igrac prihvatiti ili ne prihvatiti ulazak u organizaciju
- // Kad dodajete novu organizaciju, morate promijeniti neke nazive u tekstu kako ne bi svaki tekst bio isti (govorim o imenu organizacije)
- format(szInviteMsg, sizeof(szInviteMsg), "Lider %s vas je pozvao u organizaciju FBI.\n\nPritisnite tipku 'Prihvacam' ako zelite prihvatiti poziv za ulazak u tu organizaciju\nili pritisnite tipku 'Odbijam' ako ne zelite prihvatiti.", szPlayerName);
- }*/
- }
- ShowPlayerDialog(iPlayerID, DIALOG_ORG_INVITE, DIALOG_STYLE_MSGBOX, "POZVANI STE U ORGANIZACIJU", szInviteMsg, "Prihvacam", "Odbijam");
- }
- else
- SendClientMessage(playerid, C_WHITE, "ERROR: Moras biti lider da koristis ovu komandu.");
- return 1;
- }
- //==============================================================================
- //==============================================================================
- CMD:rankup(playerid, params[])
- {
- if (PlayerInfo[playerid][pLider] > 0) // Provjerava da li je igrac lider icega
- {
- new
- iPlayerID,
- iRankNum,
- szPlayerName[MAX_PLAYER_NAME],
- szMessage[71];
- if (sscanf(params, "ud", iPlayerID, iRankNum)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
- return SendClientMessage(playerid, C_WHITE, "KORISTI: /rankup [igracev ID/dio imena] [rank]");
- else if (iPlayerID == INVALID_PLAYER_ID) // Ako je ID igraca koji je igrac upisao nije online, ispisuje mu tu poruku
- return SendClientMessage(playerid, C_WHITE, "ERROR: Pogresan ID igraca.");
- else if (iRankNum < 1 || iRankNum > 6) // Ako je broj ranka manji od 1 ili veci od 6, ispisuje mu tu poruku
- return SendClientMessage(playerid, C_WHITE, "ERROR: ID organizacije ne smije biti manji od 1 ili veci od 6.");
- else if (PlayerInfo[iPlayerID][pClan] != PlayerInfo[playerid][pLider]) // Provjerava da li su igrac i ID igraca koji je upisao u istoj organizaciji
- return SendClientMessage(playerid, C_WHITE, "ERROR: Taj igrac nije u vasoj organizaciji.");
- PlayerInfo[iPlayerID][pRank] = iRankNum; // Postavlja igracevu varijablu na broj ranka, tako da bi kasnije mogli znati koji je igrac rank
- SetPlayerOrgSkin(iPlayerID, ((PlayerInfo[iPlayerID][pLider] > 0) ? (PlayerInfo[iPlayerID][pLider]) : (PlayerInfo[iPlayerID][pClan])), iRankNum);
- GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
- format(szMessage, sizeof(szMessage), "INFO: Lider %s ti je postavio rank na "COL_RED"%d", szPlayerName, iRankNum);
- SendClientMessage(iPlayerID, C_WHITE, szMessage);
- GetPlayerName(iPlayerID, szPlayerName, MAX_PLAYER_NAME);
- format(szMessage, sizeof(szMessage), "INFO: Postavio si clanu %s rank na "COL_RED"%d", szPlayerName, iRankNum);
- SendClientMessage(playerid, C_WHITE, szMessage);
- }
- else
- SendClientMessage(playerid, C_WHITE, "ERROR: Moras biti lider da koristis ovu komandu.");
- return 1;
- }
- stock SetPlayerOrgSkin(iPlayerID, iOrgID, iRank)
- {
- switch(iOrgID)
- {
- case 1: // Prva organizacija, nazovimo je Los Santos Police Department
- {
- switch(iRank) // Rankovi za prvu organizaciju
- {
- case 1: // 1. Rank
- PlayerInfo[iPlayerID][pOrg_Skin] = 284; // 284 je ID skina za 1. rank u LSPD organizaciji i taj broj mjenjate u svoj ID skina koji zelite
- case 2: // 2. Rank
- PlayerInfo[iPlayerID][pOrg_Skin] = 280; // 280 je ID skina za 2. rank u LSPD organizaciji i taj broj mjenjate u svoj ID skina koji zelite
- case 3: // 3. Rank
- PlayerInfo[iPlayerID][pOrg_Skin] = 281; // 281 je ID skina za 3. rank u LSPD organizaciji i taj broj mjenjate u svoj ID skina koji zelite
- case 4: // 4. Rank
- PlayerInfo[iPlayerID][pOrg_Skin] = 282; // 282 je ID skina za 4. rank u LSPD organizaciji i taj broj mjenjate u svoj ID skina koji zelite
- case 5: // 5. Rank
- PlayerInfo[iPlayerID][pOrg_Skin] = 282; // 282 je ID skina za 5. rank u LSPD organizaciji i taj broj mjenjate u svoj ID skina koji zelite
- case 6: // 6. Rank
- PlayerInfo[iPlayerID][pOrg_Skin] = 288; // 288 je ID skina za 6. rank u LSPD organizaciji i taj broj mjenjate u svoj ID skina koji zelite
- default:
- PlayerInfo[iPlayerID][pOrg_Skin] = 284; // Ovaj ID skina neka vam bude uvijek jednak 1. ranku, on je tu samo ako je doslo do neke greske kod broja ranka
- }
- }
- // Ovaj kod ispod kao da ne postoji, ali vam prikazuje kako dodati jos jednu organizaciju, sto je potrebno svaki put kada zelite dodati novu organizaciju
- /*case 2: // Druga organizacija, nazovimo je FBI
- {
- switch(iRank) // Rankovi za drugu organizaciju
- {
- case 1: // 1. Rank
- PlayerInfo[iPlayerID][pOrg_Skin] = 166; // 166 je ID skina za 1. rank u FBI organizaciji i taj broj mjenjate u svoj ID skina koji zelite
- case 2: // 2. Rank
- PlayerInfo[iPlayerID][pOrg_Skin] = 166; // 166 je ID skina za 2. rank u FBI organizaciji i taj broj mjenjate u svoj ID skina koji zelite
- case 3: // 3. Rank
- PlayerInfo[iPlayerID][pOrg_Skin] = 165; // 165 je ID skina za 3. rank u FBI organizaciji i taj broj mjenjate u svoj ID skina koji zelite
- case 4: // 4. Rank
- PlayerInfo[iPlayerID][pOrg_Skin] = 165; // 165 je ID skina za 4. rank u FBI organizaciji i taj broj mjenjate u svoj ID skina koji zelite
- case 5: // 5. Rank
- PlayerInfo[iPlayerID][pOrg_Skin] = 286; // 286 je ID skina za 5. rank u FBI organizaciji i taj broj mjenjate u svoj ID skina koji zelite
- case 6: // 6. Rank
- PlayerInfo[iPlayerID][pOrg_Skin] = 286; // 286 je ID skina za 6. rank u FBI organizaciji i taj broj mjenjate u svoj ID skina koji zelite
- default:
- PlayerInfo[iPlayerID][pOrg_Skin] = 166; // Ovaj ID skina neka vam bude uvijek jednak 1. ranku, on je tu samo ako je doslo do neke greske kod broja ranka
- }
- }*/
- }
- SetPlayerSkin(iPlayerID, PlayerInfo[iPlayerID][pOrg_Skin]);
- return 1;
- }
- //==============================================================================
- //==============================================================================
- CMD:izbaciizorg(playerid, params[])
- {
- if (PlayerInfo[playerid][pLider] > 0) // Provjerava da li je igrac lider icega
- {
- new
- iPlayerID,
- szPlayerName[MAX_PLAYER_NAME],
- szMessage[68];
- if (sscanf(params, "u", iPlayerID)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
- return SendClientMessage(playerid, C_WHITE, "KORISTI: /izbaciizorg [igracev ID/dio imena]");
- else if (iPlayerID == INVALID_PLAYER_ID) // Ako je ID igraca koji je igrac upisao nije online, ispisuje mu tu poruku
- return SendClientMessage(playerid, C_WHITE, "ERROR: Pogresan ID igraca.");
- else if (PlayerInfo[iPlayerID][pClan] != PlayerInfo[playerid][pLider]) // Provjerava da li su igrac i ID igraca koji je upisao u istoj organizaciji
- return SendClientMessage(playerid, C_WHITE, "ERROR: Taj igrac nije u vasoj organizaciji.");
- PlayerInfo[iPlayerID][pClan] = 0; // Resetira igracevu varijablu jer vise nije u organizaciji
- PlayerInfo[iPlayerID][pRank] = 0; // Resetira igracevu varijablu jer vise nije u organizaciji
- PlayerInfo[iPlayerID][pOrg_Skin] = 0; // Resetira igracevu varijablu jer vise nije u organizaciji
- SetPlayerSkin(iPlayerID, PlayerInfo[iPlayerID][pSkin]); // Vraca igracev skin koji je imao prije ulaska u organizaciju
- GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
- format(szMessage, sizeof(szMessage), "INFO: Lider %s te je izbacio iz organizacije.", szPlayerName);
- SendClientMessage(iPlayerID, C_WHITE, szMessage);
- GetPlayerName(iPlayerID, szPlayerName, MAX_PLAYER_NAME);
- format(szMessage, sizeof(szMessage), "INFO: Izbacio si clana %s iz organizacije.", szPlayerName);
- SendClientMessage(playerid, C_WHITE, szMessage);
- }
- else
- SendClientMessage(playerid, C_WHITE, "ERROR: Moras biti lider da koristis ovu komandu.");
- return 1;
- }
- //==============================================================================
- //==============================================================================
- CMD:r(playerid, params[])
- {
- if (PlayerInfo[playerid][pClan] > 0 || PlayerInfo[playerid][pLider] > 0)
- {
- new
- szChatMsg[128],
- szPlayerName[MAX_PLAYER_NAME],
- szMessage[128];
- if (sscanf(params, "s[128]", szChatMsg)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
- return SendClientMessage(playerid, C_WHITE, "KORISTI: (/r)adio [tekst]");
- GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
- foreach(new iPlayerID : Player)
- {
- // Prolazi kroz sve online igrace i provjerava da li su u istoj organizaciji kao i posiljatelj poruke
- if (PlayerInfo[iPlayerID][pClan] == PlayerInfo[playerid][pClan] || PlayerInfo[iPlayerID][pLider] == PlayerInfo[playerid][pLider])
- {
- format(szMessage, sizeof(szMessage), "%s %s kaze: %s", GetPlayerRank(playerid), szPlayerName, szChatMsg);
- SendClientMessage(iPlayerID, C_WHITE, szMessage);
- }
- }
- }
- else
- SendClientMessage(playerid, C_WHITE, "ERROR: Moras biti clan neke organizacije da koristis ovu komandu.");
- return 1;
- }
- CMD:radio(playerid, params[])
- return cmd_r(playerid, params);
- stock GetPlayerRank(iPlayerID) // By Joey_
- {
- new
- szRankName[16], // Broj 16 morate promijeniti ako imate rank ime vece od 15 znakova
- iPlayerOrg = (PlayerInfo[iPlayerID][pClan] > 0) ? (PlayerInfo[iPlayerID][pClan]) : (PlayerInfo[iPlayerID][pLider]);
- switch(iPlayerOrg)
- {
- case 1: // Prva organizacija, nazovimo je Los Santos Police Department
- {
- switch(PlayerInfo[iPlayerID][pRank]) // Rankovi za prvu organizaciju
- {
- case 1: // 1. Rank
- szRankName = "Vježbenik";
- case 2: // 2. Rank
- szRankName = "Kadet";
- case 3: // 3. Rank
- szRankName = "Policajac";
- case 4: // 4. Rank
- szRankName = "Viši Policajac";
- case 5: // 5. Rank
- szRankName = "Narednik";
- case 6: // 6. Rank
- szRankName = "Porucnik";
- default:
- szRankName = "Nepoznato";
- }
- }
- // Ovaj kod ispod kao da ne postoji, ali vam prikazuje kako dodati jos jednu organizaciju, sto je potrebno svaki put kada zelite dodati novu organizaciju
- /*case 1: // Druga organizacija, nazovimo je FBI
- {
- switch(PlayerInfo[iPlayerID][pRank]) // Rankovi za drugu organizaciju
- {
- case 1: // 1. Rank
- szRankName = "Vojnik";
- case 2: // 2. Rank
- szRankName = "Vojnik";
- case 3: // 3. Rank
- szRankName = "Zapovjednik";
- case 4: // 4. Rank
- szRankName = "Zapovjednik";
- case 5: // 5. Rank
- szRankName = "Zapovjednik";
- case 6: // 6. Rank
- szRankName = "General";
- default:
- szRankName = "Nepoznato";
- }
- }*/
- }
- return szRankName;
- }
- //==============================================================================
- //==============================================================================
- COMMAND:eject(playerid,params[])
- {
- new
- id,
- string[128];
- if(sscanf(params, "u", id)) return SCM(playerid, COLOR_GREY, "Koristi: /eject [ID]");
- else if (id == INVALID_PLAYER_ID) SCM(playerid, COLOR_GREY, "ERROR: Igrac nije online.");
- else
- {
- if( id == playerid ) return SCM(playerid,COLOR_GREY,"ERROR: Nemozes sam sebe izbaciti iz vozila.");
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(GetPlayerVehicleSeat(playerid) == 0)
- {
- if(!IsPlayerInAnyVehicle(id)) return SCM(playerid,COLOR_GREY,"ERROR: Taj igrac nije u vozilu.");
- if(GetPlayerVehicleSeat(id) != 0) {
- RemovePlayerFromVehicle(id);
- format(string,sizeof string,"INFO: %s vas je izbacio iz vozila.",GetName(playerid));
- SCM(id,0xFF6600,string);
- format(string,sizeof string,"INFO: Izbacio si %s van svog vozila.",GetName(id));
- SCM(playerid,0xFF6600,string); }
- else
- {
- SCM(playerid,COLOR_GREY,"ERROR: Nemozes izbaciti vozaca van vozila.");
- }
- }
- else
- {
- SCM(playerid,COLOR_GREY,"ERROR: Samo vozac ovog vozila moze izbacivati igrace van vozila.");
- }
- }
- else
- {
- SCM(playerid,COLOR_GREY,"ERROR: Niste u vozilu.");
- }
- }
- return true;
- }
- stock GetName(id)
- {
- new
- ime[MAX_PLAYER_NAME];
- GetPlayerName(id,ime, MAX_PLAYER_NAME);
- return ime;
- }
- //==============================================================================
- //==============================================================================
- COMMAND:hesoyam(playerid, params[])
- {
- if (IsPlayerAdmin(playerid))
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- GivePlayerMoney(playerid, 250000);
- SetPlayerHealth(playerid, 100);
- SetPlayerArmour(playerid, 100);
- if(IsPlayerInAnyVehicle(playerid)) return RepairVehicle(vehicleid);
- }
- else
- {
- return SendClientMessage(playerid, COLOR_GREY, "ERROR: Niste Rcon");
- }
- return 0;
- }
- //==============================================================================
- //==============================================================================
- CMD:rppravila(playerid, params[])
- {
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "RP Pravila:","RP(RolePlay)Simulacija stvarnog zivota\nSK(SpawnKill)Ubijanje na mestu Spawna\nMG(MetaGaming)Mesanje IC i OOC chata\nPG(PowerGaming)Nemoguca radnja\nBH(BunnyHopping)Skakanje i trcanje u isto vreme\nDM(DeathMaching)Ubijanje ljudi bez razloga\nNJ-kradja auta bez /me komandi\nBA(Bug Abusing)Iskoriscavanje propusta na serveru\nNadamo se da ste naucili ova pravila,jer ako ih ne postujete,mozete dobiti warn ili ban. !", "Shvatam","Izadji");
- return 1;
- }
- //==============================================================================
- //==============================================================================
- CMD:smash(playerid,params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Nisi Administrator");
- new ID;
- if(sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, "/smash (ID)");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1,"Korisnik nije prisutan");
- if(!IsPlayerInAnyVehicle(ID)) return SendClientMessage(playerid, -1,"Korisnik nije u vozliu");
- SetVehicleVelocity(GetPlayerVehicleID(ID), 0.0, 0.0, 100);
- SetTimerEx("Velecity", 500, false, "u", ID);
- return 1;
- }
- forward Velecity(playerid);
- public Velecity(playerid)
- {
- if(IsPlayerInAnyVehicle(playerid))
- SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, -300);
- return 1;
- }
- //==============================================================================
- //==============================================================================
- CMD:veh(playerid, params[])
- {
- new
- vID,
- Cl1,
- Cl2,
- Float:X,
- Float:Y,
- Float:Z,
- Float:Ang;
- if (IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "[ERROR]: Nisi Admin!");
- if(sscanf(params, "ii", vID, Cl1, Cl2)) return SendClientMessage(playerid, 0xFF6600, "{0000FF}[SX:RP | KOMANDA]:{FF8040} /veh <vehicleid> <boja1> <boja2>");
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, Ang);
- CreateVehicle(vID, X + 5.0, Y, Z, Ang, Cl1, Cl2, 1200000);
- return true;
- }
- //==============================================================================
- //==============================================================================
- CMD:o(playerid, params[])
- {
- new oMsg[128], pName[MAX_PLAYER_NAME];
- if(OOC == 1)
- {
- new Text[128];
- if(sscanf(params, "s", Text)) return SendClientMessage(playerid, 0xFF8040FF, "KORISTI: /o <text>");
- GetPlayerName(playerid, pName, sizeof(pName));
- format(oMsg, sizeof(oMsg), "(( %s: %s ))", pName, params);
- SendClientMessageToAll(0xBFEFFFAA, oMsg);
- }
- else if(!IsPlayerAdmin(playerid))
- {
- new Text[128];
- if(sscanf(params, "s", Text)) return SendClientMessage(playerid, 0xFF8040FF, "KORISTI: /o <text>");
- GetPlayerName(playerid, pName, sizeof(pName));
- format(oMsg, sizeof(oMsg), "(( Admin %s: %s ))", pName, params);
- SendClientMessageToAll(0xFFFF00AA, oMsg);
- }
- else SendClientMessage(playerid, COLOR_BLUE, "[OOC]: OOC Chat je iskljucen.");
- return 1;
- }
- //==============================================================================
- //==============================================================================
- COMMAND:slap(playerid, params[])
- {
- new str[128], targetid;
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xCECECEFF, "Nisi ovlasten da koristis ovu komandu!.");
- if(sscanf(params,"u", targetid))return SendClientMessage(playerid, 0xCECECEFF, "Koristi: /slap [ID igraca/Dio imena]");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xCECECEFF, "ID nije pronadjen.");
- new Float: PosX, Float: PosY, Float: PosZ;
- GetPlayerPos(targetid, PosX, PosY, PosZ);
- SetPlayerPos(targetid, PosX, PosY, PosZ + 5.0);
- SendClientMessage(playerid, 0xF81414,"osamarioi si %s");
- SendClientMessage(playerid, 0xFFFFFFFF, str);
- GameTextForPlayer(targetid, "~r~ OSAMAREN", 3000, 4);
- return 1;
- }
- stock Accounts(playerid)
- {
- new PlayerAcc[128];
- format(PlayerAcc,128,"Users/%s.ini",GetOOCName(playerid));
- return PlayerAcc;
- }
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
- //==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment