Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //============================CREDITS : JIZZY=================================//
- // CELU SKRIPTU NAPRAVIO JIZZY
- // UZIVAJTE
- //============================================================================//
- #include <a_samp>
- #include <zcmd>
- #include <YSI\y_ini>
- #include <sscanf2>
- #include <foreach>
- //============================================================================//
- #if defined FILTERSCRIPT
- #define IGRACI_FOLDER "/Korisnici/%s.ini"
- #define SCM SendClientMessage
- #define SCMTA SendClinetMessageToAll
- //============================================================================//
- stock GetName(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name, sizeof(name)); return name; }
- new sduty [MAX_PLAYES];
- enum
- {
- pNovac,
- pSupporter
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[]);
- {
- INI_int("Novac",PlayerInfo[playerid][pNovac]);
- INI_int("Supporter,PlayerInfo[playerid][pSupporter]);
- return 1;
- }
- stock UserPath(playerid)
- {
- new str[120];
- format(str,sizeof(str),IGRACI_FOLDER,GetName(playerid));
- return str;
- }
- stock SacuvajIgraca(playerid)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"Data");
- INI_WriteInt(File,"Novac",GetPlayerMoney(playerid));
- INI_WriteInt(File,"Supporter",PlayerInfo[playerid][pSupporter]);
- INI_Close(File);
- }
- main()
- {
- print("\n-------------------------");
- print(" ");
- print("-------------------------\n");
- }
- public OnGameModeInit()
- {
- SetGameModeText("Supporter system by Jizzy");
- 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);
- }
- else
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Novac",0);
- INI_WriteInt(File,"Supporter",0);
- INI_Close(File);
- }
- return 1;
- }
- public OnPlayerDissconect(playerid, reason)
- {
- SacuvajIgraca(playerid);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason);
- {
- return 1;
- }
- //============================================================================//
- //komande
- CMD:makesupporter(playerid,params[]);
- {
- if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pSupporter] == 3)
- {
- new id,level;
- if(sscanf(params,"ud",id,level)) return SCM(playerid,-1,"Koristi:/makesupporter [name/id] [level]");
- if(!IsPlayerConnected(id)) return SCM(playerid,-1,"Igrac nije konektovan");
- if(level < 1 || level > 3) return SCM(playerid,-1,"minimum 1 maksimum 3");
- PlayerInfo[id][pSupporter] = level;
- new str[120],str1[120];
- format(str,sizeof(str),"Admin/Supporter %s ti je postavio supportera level %d",GetName(playerid),level);
- SCM(id,-1,str);
- format(str1,sizeof(str1),"Igracu %s si postavio supporter level na %d",GetName(id),level);
- SCM(id,-1,str1);
- }
- else
- {
- SCM(playerid,-1,"Nisi ovlascen!");
- }
- return 1;
- }
- CMD:cc(playerid,params[])
- {
- if(sduty[playerid] == 0) return SCM(playerid,-1,"Nisi na duznosti !");
- if(PlayerInfo[playerid][pSupporter] >= 1);
- {
- for(new i=0;i<120;i++)
- {
- SendClinetMessageToAll(-1,"");
- }
- new str[120];
- format(str,sizeof(str),"Admin/Supporter %s je ocistio chat!",GetName(playerid));
- SendClinetMessageToAll(-1,str);
- }
- else
- {
- SCM(playerid,-1,"Nisi ovlascen!");
- }
- return 1;
- }
- CMD:sc(playerid,params[])
- {
- if(sduty[playerid] == 0) return SCM(playerid,-1,"Nisi na duznosti !");
- if(PlayerInfo[playerid][pSupporter] >= 1)
- {
- new text[120];
- if(sscanf(params,"s[120]",text)) return SCM(playerid,-1,"Koristi:/sc [tekst]")
- new str[154];
- format(str,sizeof(str),"|SC| %s | %s |",GetName(playerid), text);
- for(new i=0;i<MAX_PLAYERS;i++
- {
- if(PlayerInfo[i][pSupporter] >= 1)
- {
- SCM(i,-1,str);
- }
- }
- }
- else
- {
- SCM(playerid,-1,"Nisi ovlascen!");
- }
- return 1;
- }
- CMD:so(playerid,params[])
- {
- if(sduty[playerid] == 0) return SCM(playerid,-1,"Nisi na duznosti !");
- if(PlayerInfo[playerid][pSupporter] >= 1)
- {
- new text[120];
- if(sscanf(params,"s[120]",text)) return SCM(playerid,-1,"Koristi:/sc [tekst]")
- new str[200];
- format(str,sizeof(str),"((OOC | Supporter %s | %s |))",GetName(playerid), text);
- SCMTA(-1,str);
- }
- else
- {
- SCM(playerid,-1,"Nisi ovlascen!");
- }
- return 1;
- }
- CMD:sduty(playerid,params[])
- {
- if(PlayerInfo[playerid][pSupporter] >= 1)
- {
- if(sduty[playerid] == 0)
- {
- new str[100];
- format(str,sizeof(str),"Supporter %s je na duznosti !",GetName(playerid));
- SCMTA(-1,str);
- SetPlayerHealth(playerid,99);
- SetPlayerArmour(playerid,99);
- sduty[playerid] = 1;
- }
- else if(sduty[playerid] == 1);
- {
- new str1[100];
- format(str,sizeof(str1),"Supporter %s nije vise na duznosti !",GetName(playerid));
- SCMTA(-1,str1);
- sduty[playerid] = 0;
- }
- }
- return 1;
- }
- CMD:goto(playerid,params[])
- {
- if(sduty[playerid] == 0) return SCM(playerid,-1,"Nisi na duznosti !");
- if(PlayerInfo[playerid][pSupporter] >= 1)
- {
- new id;
- if(sscanf(params,"u",id)) return SCM(playerid,-1,"Koristi /goto [name/id]");
- if(!IsPlayerConnected(id)) return SCM(playerid,-1,"Igrac nije konektovan !");
- new Float:x,Float:y,Float:z;
- GetPlayerPos(id,x,y,z);
- if(IsPlayerInAnyVehicle(playerid))
- {
- SetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
- }
- else if(IsPlayerInAnyVehicle(playerid))
- {
- SetPlayerPos(playerid,x,y,z);
- }
- }
- return 1;
- }
- CMD:bring(playerid,params[])
- {
- if(sduty[playerid] == 0) return SCM(playerid,-1,"Nisi na duznosti !");
- if(PlayerInfo[playerid][pSupporter] >= 1)
- {
- new id;
- if(sscanf(params,"u",id)) return SCM(playerid,-1,"Koristi /goto [name/id]");
- if(!IsPlayerConnected(id)) return SCM(playerid,-1,"Igrac nije konektovan !");
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- if(IsPlayerInAnyVehicle(id))
- {
- SetVehiclePos(GetPlayerVehicleID(id),x,y,z);
- }
- else if(IsPlayerInAnyVehicle(id))
- {
- SetPlayerPos(id,x,y,z);
- }
- }
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate);
- {
- return 1;
- }
- ////////////////////////////////////////////////////////////////////////////////
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement