Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include ESF/E_GVar_P
- #include streamer
- new JobCount = -1;
- stock AddJob(id,Float:x,Float:y,Float:z,intr,vw,bool:usem,map,pay,A,B,C,D,Z,Pl,Bl,color,name[])
- {
- JobCount++;
- SetGVarInt("ID_Povolani",id,JobCount);
- SetGVarFloat("Pozice_X",x,JobCount);
- SetGVarFloat("Pozice_Y",y,JobCount);
- SetGVarFloat("Pozice_Z",z,JobCount);
- SetGVarInt("Interier",intr,JobCount);
- SetGVarInt("VirtualWorld",vw,JobCount);
- SetGVarInt("Icona",map,JobCount);
- if(usem == true)
- {
- CreateDynamicMapIcon(GetGVarFloat("Pozice_X",JobCount), GetGVarFloat("Pozice_Y",JobCount), GetGVarFloat("Pozice_Z",JobCount), GetGVarInt("Icona",JobCount), -1);
- }
- SetGVarInt("Vyplata",pay,JobCount);
- SetGVarInt("Require_A",A,JobCount);
- SetGVarInt("Require_B",B,JobCount);
- SetGVarInt("Require_C",C,JobCount);
- SetGVarInt("Require_D",D,JobCount);
- SetGVarInt("Require_Z",Z,JobCount);
- SetGVarInt("Require_Pl",Pl,JobCount);
- SetGVarInt("Require_Bl",Bl,JobCount);
- SetGVarInt("Barva",color,JobCount);
- SetGVarString("Jmeno",name,JobCount);
- new nmn[128];
- GetGVarString("Jmeno",nmn,JobCount);
- Pickup(1581,1,GetGVarFloat("Pozice_X",JobCount), GetGVarFloat("Pozice_Y",JobCount), GetGVarFloat("Pozice_Z",JobCount),GetGVarInt("VirtualWorld",JobCount),"JobPick");
- new string[400];
- format(string,400,"[%s]\nHrubá mzda : %d$\n=============\nLicence A %s\nLicence B %s\nLicence C\nLicence D %s\nZbrojní licence %s\nPilotní licence %s\nLodní licence %s\nStickni \"L.ALT\".",
- nmn,GetGVarInt("Vyplaty",JobCount),YN(GetGVarInt("Require_A",JobCount)),YN(GetGVarInt("Require_B",JobCount)),YN(GetGVarInt("Require_C",JobCount)),YN(GetGVarInt("Require_D",JobCount)),YN(GetGVarInt("Require_Z",JobCount)),YN(GetGVarInt("Require_Pl",JobCount)),YN(GetGVarInt("Require_Bl",JobCount)));
- Create3DTextLabel(string,0xFFFFFFFF,GetGVarFloat("Pozice_X",JobCount), GetGVarFloat("Pozice_Y",JobCount), GetGVarFloat("Pozice_Z",JobCount),40.0,GetGVarInt("VirtualWorld",JobCount),1);
- }
- stock YN(func)
- {
- new s[5];
- if(func == 0) format(s,5,"Ne");
- else if(func == 1) format(s,5,"Ano");
- return s;
- }
- stock GetJobID(playerid)
- {
- for(new a = 0;a < JobCount;a++)
- {
- if(IsPlayerConnected(playerid))
- {
- if(!IsPlayerInAnyVehicle(playerid))
- {
- if(IsPlayerInRangeOfPoint(playerid,1.5,GetGVarFloat("Pozice_X",a), GetGVarFloat("Pozice_Y",a), GetGVarFloat("Pozice_Z",a)))return a;
- }
- }
- }
- return -1;
- }
- public OnPlayerSpawn(playerid)
- {
- new a = GetJobID(playerid);
- if(GetPVarInt(playerid,"Spawn_V_Dome") == 0 && GetPVarInt(playerid,"Povolani") != 0)
- {
- SetPlayerPos(playerid,GetGVarFloat("Pozice_X",a), GetGVarFloat("Pozice_Y",a), GetGVarFloat("Pozice_Z",a));
- }
- return 1;
- }
- stock Jmeno(playerid)
- {
- new nm[21];
- GetPlayerName(playerid,nm,21);
- return nm;
- }
- stock Kolegove(playerid)
- {
- new string_b[256];
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- if(IsPlayerConnected(i) && !IsPlayerNPC(i))
- {
- if(GetPVarInt(playerid,"Povolani") == 0)return 0;
- if(GetPVarInt(i,"Povolani") == GetPVarInt(playerid,"Povolani"))
- {
- format(string_b,sizeof(string_b),"{FFFFFF}%s\n",i,Jmeno(i));
- }
- }
- }
- ShowPlayerDialog(playerid,0,DIALOG_STYLE_LIST,"Tvoji Kolegové",string_b,"Ok","Konec");
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- new string[50],name[40];
- GetGVarString("PickupName", name, 40, pickupid);
- format(string,15,"qpick_%s",name);
- if(!strcmp(name,"none",false)) CallRemoteFunction("OnPlayerPickupUpPickupEx","ii",playerid,pickupid);
- else CallRemoteFunction(string,"i",playerid);
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- new a = GetJobID(playerid);
- if(IsPlayerInRangeOfPoint(playerid,1.5,GetGVarFloat("Pozice_X",a), GetGVarFloat("Pozice_Y",a), GetGVarFloat("Pozice_Z",a)))
- {
- if(newkeys == KEY_WALK)
- {
- new nmn[128];
- GetGVarString("Jmeno",nmn,a);
- ShowPlayerDialog(playerid,10,DIALOG_STYLE_LIST,nmn,"{FFFFFF}Zaměstnat se\nVýpověď\nKolegové","Zvolit","Odejít");
- }
- }
- return 1;
- }
- forward Vyplaty(playerid);
- public Vyplaty(playerid)
- {
- if(GetPVarInt(playerid,"Povolani") == 0) return 0;
- new Money = GetGVarInt("Vyplata",GetPVarInt(playerid,"Povolani")),string[128],str[64],string1[128];
- GetGVarString("Jmeno",str,GetPVarInt(playerid,"Povolani"));
- format(string,128,"------| %s |------",str);
- format(string1,128,"Dostal jsi výplatu %d $",Money - random(3000));
- SendClientMessage(playerid,-1,string);
- SendClientMessage(playerid,-1,string1);
- SendClientMessage(playerid,-1,"----------------");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 10)
- {
- if(response == 1)
- {
- if(listitem == 0)
- {
- if(GetPVarInt(playerid,"Povolani") != 0)return SendClientMessage(playerid,-1,"Již jsi zaměstnán");
- else if(GetPVarInt(playerid,"Povolani") == GetGVarInt("ID_Povolani",GetJobID(playerid)))return SendClientMessage(playerid,-1,"Již jsi zde zaměstnán");
- if(GetGVarInt("Require_A",GetJobID(playerid)) == 1 && GetPVarInt(playerid,"A") == 0)return SendClientMessage(playerid,-1,"Nemas Licenci A.Toto povolani ji vyzaduje");
- if(GetGVarInt("Require_B",GetJobID(playerid)) == 1 && GetPVarInt(playerid,"B") == 0)return SendClientMessage(playerid,-1,"Nemas Licenci B.Toto povolani ji vyzaduje");
- if(GetGVarInt("Require_C",GetJobID(playerid)) == 1 && GetPVarInt(playerid,"C") == 0)return SendClientMessage(playerid,-1,"Nemas Licenci C.Toto povolani ji vyzaduje");
- if(GetGVarInt("Require_D",GetJobID(playerid)) == 1 && GetPVarInt(playerid,"D") == 0)return SendClientMessage(playerid,-1,"Nemas Licenci D.Toto povolani ji vyzaduje");
- if(GetGVarInt("Require_Z",GetJobID(playerid)) == 1 && GetPVarInt(playerid,"Z") == 0)return SendClientMessage(playerid,-1,"Nemas Zbrojni licence.Toto povolani ji vyzaduje");
- if(GetGVarInt("Require_Pl",GetJobID(playerid)) == 1 && GetPVarInt(playerid,"Pl") == 0)return SendClientMessage(playerid,-1,"Nemas pilotni licenci.Toto povolani ji vyzaduje");
- if(GetGVarInt("Require_Bl",GetJobID(playerid)) == 1 && GetPVarInt(playerid,"Bl") == 0)return SendClientMessage(playerid,-1,"Nemas Lodni licenci.Toto povolani ji vyzaduje");
- SetPVarInt(playerid,"Povolani",GetGVarInt("ID_Povolani",GetJobID(playerid)));
- }
- else if(listitem == 1)
- {
- if(GetPVarInt(playerid,"Povolani") == 0)return SendClientMessage(playerid,-1,"Nejsi zaměstnán");
- else if(GetPVarInt(playerid,"Povolani") != GetGVarInt("ID_Povolani",GetJobID(playerid)))return SendClientMessage(playerid,-1,"Nejsi zde zaměstnán");
- SetPVarInt(playerid,"Povolani",0);
- }
- else if(listitem == 2)
- {
- Kolegove(playerid);
- }
- }
- }
- return 1;
- }
- public OnFilterScriptInit()
- {
- AddJob(1,0,0,0,0,1,true,21,12,1,1,1,1,1,1,1,-1,"dfsd");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement