[Pomoc]Hapsenje

Započeo caupton, Maj 20, 2011, 11:49:08 PRE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.


Skripta koju koristim:BD|Faction Game|
Detaljan opis problema:Kako kada policijac ili bia kucaju /arrest i kada nekog uhapse da dobiju odmah u dzep 3000$ ali samo kada nekog uhapse a ne ono npr kada spamaju da dobijaju pare,nego samo kada je neko vezan u vozilu oni kucaj /arrest 3000 1 1 1 i onda dobiju 3k u dzep kod sebe
Dio skripte://
Neke slike/video za lakse dobivanje pomoci(neobavezno)://













Command:

if(strcmp(cmd, "/arrest", true) == 0 || strcmp(cmd, "/uhapsi", true) == 0)
   {
       if(IsPlayerConnected(playerid))
         {
         if(gTeam[playerid] == 2  || IsACop(playerid))
         {
            if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Niste na duznosti!");
                return 1;
            }
              /*if(!PlayerToPoint(6.0, playerid, 268.3327,77.8972,1001.0391) || !PlayerToPoint(15.0, playerid,1537.2515,-1674.9572,13.3828))
            {// Jail spot
                SendClientMessage(playerid, COLOR_GREY, "   You are not near the Jail, can't Arrest!");
                return 1;
            }*/

            if(PlayerToPoint(6.0, playerid, 268.3327,77.8972,1001.0391) || PlayerToPoint(15.0, playerid,1537.2515,-1674.9572,13.3828) || PlayerToPoint(6.0, playerid, 1528.9080,-1678.0759,5.8906) || PlayerToPoint(6.0, playerid, -1606.9096,677.2825,-5.2421))
            {//New arrest system

               tmp = strtok(cmdtext, idx);
               if(!strlen(tmp))
               {
                  SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /uhapsi [novcana kazna] [vrijeme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
                  return 1;
               }
               moneys = strval(tmp);
               if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, "   Novcana kazna ne moze biti ispod $1 ni iznad $99999!"); return 1; }
               tmp = strtok(cmdtext, idx);
               if(!strlen(tmp))
               {
                  SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /uhapsi [novcana kazna] [vrijeme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
                  return 1;
               }
               new time = strval(tmp);
               if(time < 1 || time > 60) { SendClientMessage(playerid, COLOR_GREY, "   Zatvorska kazna ne moze biti ispod 1 ni iznad 20 minuta!"); return 1; }
               tmp = strtok(cmdtext, idx);
               if(!strlen(tmp))
               {
                  SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /uhapsi [novcana kazna] [vrijeme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
                  return 1;
               }
               new bail = strval(tmp);
               if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, "   Da se dozvoli ili ponisti kaucija, kucajte 0 ili 1!"); return 1; }
               tmp = strtok(cmdtext, idx);
               if(!strlen(tmp))
               {
                  SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /uhapsi [novcana kazna] [vrijeme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
                  return 1;
               }
               new bailprice = strval(tmp);
               if(bailprice < 0 || bailprice > 3000000) { SendClientMessage(playerid, COLOR_GREY, "   Kaucija ne moze biti ispod $0 ni iznad $3000000!"); return 1; }
               new suspect = GetClosestPlayer(playerid);
               if(IsPlayerConnected(suspect))
               {
                  if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
                  {
                     GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
                     GetPlayerName(playerid, sendername, sizeof(sendername));
                     if(WantedLevel[suspect] < 1)
                     {
                         SendClientMessage(playerid, COLOR_GREY, "   Igrac mora imati barem Wanted Level 1!");
                         return 1;
                     }
                     format(string, sizeof(string), "* Uhapsili ste %s-a!", giveplayer);
                     SendClientMessage(playerid, COLOR_WHITE, string);
                     SafeGivePlayerMoney(suspect, -moneys);
                     format(string, sizeof(string), "uhapsio vas je %s ~n~    za $%d", sendername, moneys);
                     GameTextForPlayer(suspect, string, 5000, 5);
                     SafeResetPlayerWeapons(suspect);
                     if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
                     {
                         new currank[64];
                         if(PlayerInfo[playerid][pRank] == 1) { currank = "Cadet"; }
                        else if(PlayerInfo[playerid][pRank] == 2) { currank = "Police Officer"; }
                        else if(PlayerInfo[playerid][pRank] == 3) { currank = "Corporal"; }
                        else if(PlayerInfo[playerid][pRank] == 4) { currank = "Sergeant"; }
                        else if(PlayerInfo[playerid][pRank] == 5) { currank = "Lieutenant"; }
                          else if(PlayerInfo[playerid][pRank] == 6) { currank = "Captain"; }
                          else if(PlayerInfo[playerid][pRank] == 7) { currank = "Deputy Chief"; }
                          else if(PlayerInfo[playerid][pRank] == 8) { currank = "Chief"; }
                        else { currank = "Cadet"; }
                        format(string, sizeof(string), "[Policija] %s %s je uhapsio %s-a", currank ,sendername, giveplayer);
                        OOCNews(COLOR_BLUE, string);
                     }
                     else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
                     {
                        format(string, sizeof(string), "[Policija] Agent %s je uhapsio %s-a", sendername, giveplayer);
                        OOCNews(COLOR_BLUE, string);
                     }
                     SetPlayerInterior(suspect, 0);
                     SetPlayerWorldBounds(suspect,-1052.6142,-1179.6550,-931.2334,-1058.4941)
                     SetPlayerPos(suspect,-1123.5748,-999.8547,129.2187);
                     //SetPlayerHealth(suspect,0)
                     TogglePlayerControllable(suspect, 1);
                     PlayerCuffed[suspect] = 0;
                     PlayerInfo[suspect][pJailTime] = time * 60;
                     if(bail == 1)
                     {
                        JailPrice[suspect] = bailprice;
                        format(string, sizeof(string), "Uhapseni ste na %d sekundi.   Kaucija: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
                        SendClientMessage(suspect, COLOR_WHITE, string);
                     }
                     else
                     {
                         JailPrice[suspect] = 0;
                        format(string, sizeof(string), "Uhapseni ste na %d sekundi.   Kaucija: Nedostupna", PlayerInfo[suspect][pJailTime]);
                        SendClientMessage(suspect, COLOR_WHITE, string);
                     }
                     PlayerInfo[suspect][pJailed] = 1;
                          PlayerInfo[suspect][pArrested] += 1;
                     SetPlayerFree(suspect,playerid, "Uhapsen");
                     WantedPoints[suspect] = 0;
                     WantedLevel[suspect] = 0;
                     WantLawyer[suspect] = 1;
                  }//distance
               }//not connected
               else
               {
                   SendClientMessage(playerid, COLOR_GREY, "   Nema nikoga u blizini za hapsenje.");
                   return 1;
               }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Niste na mjestu za hapsenje.");
                return 1;
            }
         }
         else
         {
             SendClientMessage(playerid, COLOR_GREY, "   Niste Policajac / BIA!");
             return 1;
         }
      }//not connected
      return 1;
   }

GivePlayerMoney(playerid, 3000); ??
drugi put stavi to u [code=c] [/code]
Poslednja Izmena: Maj 20, 2011, 11:55:15 PRE PODNE od [AG] System32
Uskoro novi stunt server iStunt. DoÄ'ite i zabavite se!




   
   




Dizajniram za $$$
Popis stvari koje radim:

Wallpaper √  Signature ×  Logo √  Dizajn stranice (Ne kodiranje) √  Baner √  Avatar √  Animacija √  Intro √

gde tacno ovo da stavim posto : GivePlayerMoney(playerid, 3000);

Ispod

  format(string, sizeof(string), "* Uhapsili ste %s-a!", giveplayer);
                     SendClientMessage(playerid, COLOR_WHITE, string);


Dodaj

SafeGivePlayerMoney(playerid, 3000);
Citat: ...Neno... poslato Januar 26, 2013, 23:31:02 POSLE PODNE
Poceo sam mapati i tu je doslo do problema.Nakon par mapa,vidio sam post Gottia i kaze da nista nevalja da je katastrofa,i pocnemo se svadjati,psovati.Popusimo bananu obojica,i nakon toga nesto sam napravio (mapu) i Gotti kaze dobra,uh reko opet me zajebava,i saljem ja njemu na pm reko ti mene zajebavas,kaze on ne,i pomirimo se.Nakon toga postali smo dosta dobri