Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define MAX_PREPREKA 10
- #define PREPREKA_SRINA 5
- #define PREPREKA_DUZINA 5
- new aPrepreka[MAX_PREPREKA];
- new PreprekaSlot[2][MAX_PLAYERS];
- new Iterator:it_prepreka<MAX_PREPREKA>;
- ////////////////////////////////////////////////
- public OnPlayerEnterDynamicArea(playerid, areaid)
- {
- foreach(new i:it_prepreka)
- {
- if(aPrepreka[i]==areaid)
- {
- if(!IsPlayerInAnyVehicle(playerid)) return 1;
- new vehicleid = GetPlayerVehicleID(playerid);
- new panels, doors, lights, tires;
- GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
- UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, 15);
- return 1;
- }
- }
- return 1;
- }
- ////////////////////////////////////////////////
- YCMD:prepreka(playerid, params[], help)
- {
- #pragma unused help
- if(UlogovanProvera[playerid] == 0) return SCM(playerid,-1,"MC:RP | "CRVENA"Moras se ulogovati da bi koristio ovu komandu!");
- if(PlayerInfo[playerid][pClan] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pClan] == 7 || PlayerInfo[playerid][pLider] == 7)
- {
- if(PolicajacNaDuznosti[playerid] == 0) return SendClientMessage(playerid, -1, ""PLAVA"(LSPD) "SIVA"Niste uzeli znacku(duznost) pa nemozete koristi tu komandu!");
- if(PlayerInfo[playerid][pRank] < 3) return SCM(playerid, -1, ""PLAVA"[GRESKA] "BELA"Morate biti rank 3+ da bi koristili ovu komandu!");
- new id,Float:A; GetPlayerPos(playerid, X, Y, Z); GetPlayerFacingAngle(playerid, A);
- if(sscanf(params, "i", id))
- {
- SCM(playerid, -1, ""PPLAVA"MC:RP Pomoc | "BELA"/prepreka [Prepreke (1-4)]");
- SCM(playerid, -1, "|------------------PREPREKE-----------------|");
- SCM(playerid, -1, ""PPLAVA"(1). "BELA"M - Za Gume");
- SCM(playerid, -1, ""PPLAVA"(2). "BELA"V - Za Gume");
- SCM(playerid, -1, ""PPLAVA"(3). "BELA"Velika Blokada");
- SCM(playerid, -1, ""PPLAVA"(4). "BELA"Obicna Prepreka");
- SCM(playerid, -1, "|------------------------------------------------|");
- return 1;
- }
- if(id == 1)
- {
- if(Prepreka1Kreirana[playerid] == false)
- {
- Prepreka1[playerid] = CreateDynamicObject(2899, X, Y, Z-0.9, 0.0, 0.0, A+180);
- Prepreka1Kreirana[playerid] = true;
- new Float:x ,Float:y ,Float:z ;
- GetPlayerPos(playerid ,x ,y ,z);
- new freeSlot = Iter_Free(it_prepreka);
- PreprekaSlot[0][playerid] = freeSlot;
- Iter_Add(it_prepreka,freeSlot);
- aPrepreka[freeSlot] = CreateDynamicRectangle(x-2.2 ,y ,x + PREPREKA_SRINA ,y + PREPREKA_DUZINA );
- SCM(playerid, -1, ""SIVA"INFO | "BELA"Postavili ste prepreku!");
- }
- else return SCM(playerid, -1, ""PLAVA"(GRESKA) "BELA"Vec imate kreiranu tu prepreku.");
- }
- else if(id == 2)
- {
- if(Prepreka2Kreirana[playerid] == false)
- {
- Prepreka2[playerid] = CreateDynamicObject(2892, X+5, Y, Z-1, 0.0, 0.0, A+180);
- Prepreka2Kreirana[playerid] = true;
- new Float:x ,Float:y ,Float:z ;
- GetPlayerPos(playerid ,x ,y ,z);
- new freeSlot = Iter_Free(it_prepreka);
- PreprekaSlot[1][playerid] = freeSlot;
- Iter_Add(it_prepreka,freeSlot);
- aPrepreka[freeSlot] = CreateDynamicRectangle(x-2.2 ,y ,x + PREPREKA_SRINA ,y + PREPREKA_DUZINA );
- SCM(playerid, -1, ""SIVA"INFO | "BELA"Postavili ste prepreku!");
- }
- else return SCM(playerid, -1, ""PLAVA"(GRESKA) "BELA"Vec imate kreiranu tu prepreku.");
- }
- else if(id == 3)
- {
- if(Prepreka3Kreirana[playerid] == false)
- {
- Prepreka3[playerid] = CreateDynamicObject(981, X+5, Y, Z-0.5, 0.00000000, 0.00000000, 0.00000000);
- Prepreka3Kreirana[playerid] = true;
- SCM(playerid, -1, ""SIVA"INFO | "BELA"Postavili ste prepreku!");
- }
- else return SCM(playerid, -1, ""PLAVA"(GRESKA) "BELA"Vec imate kreiranu tu prepreku.");
- }
- else if(id == 4)
- {
- if(Prepreka4Kreirana[playerid] == false)
- {
- Prepreka4[playerid] = CreateDynamicObject(1228, X+5, Y, Z-0.5, 0.00000000, 0.00000000, 0.00000000);
- Prepreka4Kreirana[playerid] = true;
- SCM(playerid, -1, ""SIVA"INFO | "BELA"Postavili ste prepreku!");
- }
- else return SendClientMessage(playerid, -1, ""PLAVA"(GRESKA) "BELA"Vec imate kreiranu tu prepreku.");
- }
- else return SCM(playerid, -1, ""PLAVA"(GRESKA) "BELA"Pogresan ID prepreke (1-4)!");
- }
- else SendClientMessage(playerid,-1,""PLAVA"[GRESKA] "SIVA"Samo clanovi LSPD!");
- return 1;
- }
- ///////////////////////////////////////////////////////
- YCMD:unistiprepreku(playerid, params[],help)
- {
- #pragma unused help
- if(PlayerInfo[playerid][pClan] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pClan] == 7 || PlayerInfo[playerid][pLider] == 7)
- {
- if(UlogovanProvera[playerid] == 0) return SCM(playerid,-1,"MC:RP | "CRVENA"Moras se ulogovati da bi koristio ovu komandu!");
- if(PolicajacNaDuznosti[playerid] == 0) return SendClientMessage(playerid, -1, ""PLAVA"(LSPD) "SIVA"Niste uzeli znacku(duznost) pa nemozete koristi tu komandu!");
- new id;
- if(sscanf(params, "i", id)) return SCM(playerid,-1, ""PPLAVA"MC:RP Pomoc | "SIVA"/unistiprepreku [Prepreke (1-4)]");
- if(id == 1)
- {
- if(Prepreka1Kreirana[playerid] == true)
- {
- DestroyDynamicObject(Prepreka1[playerid]);
- SCM(playerid, -1, ""SIVA"INFO | "BELA"Unistili ste prepreku!");
- Prepreka1Kreirana[playerid] = false;
- Iter_Remove(it_prepreka,PreprekaSlot[0][playerid]);
- DestroyDynamicArea(aPrepreka[PreprekaSlot[0][playerid]]);
- aPrepreka[playerid] = 0;
- PreprekaSlot[0][playerid] = 0;
- }
- else return SendClientMessage(playerid, -1, ""PLAVA"(GRESKA) "BELA"Ta prepreka nije kreirana!");
- }
- else if(id == 2)
- {
- if(Prepreka2Kreirana[playerid] == true)
- {
- DestroyDynamicObject(Prepreka2[playerid]);
- SCM(playerid, -1, ""SIVA"INFO | "BELA"Unistili ste prepreku!");
- Prepreka2Kreirana[playerid] = false;
- Iter_Remove(it_prepreka,PreprekaSlot[1][playerid]);
- DestroyDynamicArea(aPrepreka[PreprekaSlot[1][playerid]]);
- aPrepreka[playerid] = 0;
- PreprekaSlot[1][playerid] = 0;
- }
- else return SendClientMessage(playerid, -1, ""PLAVA"(GRESKA) "BELA"Ta prepreka nije kreirana!");
- }
- else if(id == 3)
- {
- if(Prepreka3Kreirana[playerid] == true)
- {
- DestroyDynamicObject(Prepreka3[playerid]);
- SCM(playerid, -1, ""SIVA"INFO | "BELA"Unistili ste prepreku!");
- Prepreka3Kreirana[playerid] = false;
- }
- else return SendClientMessage(playerid, -1, ""PLAVA"(GRESKA) "BELA"Ta prepreka nije kreirana!");
- }
- else if(id == 4)
- {
- if(Prepreka4Kreirana[playerid] == true)
- {
- DestroyDynamicObject(Prepreka4[playerid]);
- SCM(playerid, -1, ""SIVA"INFO | "BELA"Unistili ste prepreku!");
- Prepreka4Kreirana[playerid] = false;
- }
- else return SendClientMessage(playerid, -1, ""PLAVA"(GRESKA) "BELA"Ta prepreka nije kreirana!");
- }
- else return SCM(playerid, -1, ""PLAVA"(GRESKA) "BELA"Pogresan ID prepreke!");
- } else SendClientMessage(playerid,-1,""PLAVA"[GRESKA] "SIVA"Samo clanovi LSPD/FBI!");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment