[Pomoc] Area

Započeo AlmirDelic, Jul 05, 2012, 16:49:13 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

AlmirDelic

   if(strcmp(cmd, "/prison",true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
           if(PlayerInfo[playerid][pAdmin] < 2)
           {
               SendClientMessage(playerid, WHITE, " Niste ovlasteni da koristite tu komandu.");
               return 1;
           }
           tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /prison [ID Igraca/Dio Imena]");
            return 1;
         }
         giveplayerid = ReturnUser(tmp);
          if(IsPlayerConnected(giveplayerid))
          {
              if(giveplayerid != INVALID_PLAYER_ID)
              {
                  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
               GetPlayerName(playerid, sendername, sizeof(sendername));
               format(string, sizeof(string), "* Stavili ste {48E31C}%s-a u "COL_WHITE"Areu-51.", giveplayer);
               SendClientMessage(playerid, ZELENKASTA, string);
               format(string, sizeof(string), "* Admin {48E31C}%s "COL_WHITE"vas je stavio u {48E31C}Areu-51.", sendername);
               SendClientMessage(giveplayerid, ZELENKASTA, string);
               GameTextForPlayer(giveplayerid, "~w~Dobrodosli u ~n~~r~Area-51", 5000, 3);
               WantedPoints[giveplayerid] = 0;
               WantedLevel[giveplayerid] = 0;
               PlayerInfo[giveplayerid][pJailed] = 2;
               PlayerInfo[giveplayerid][pJailTime] = 3600;
                  SetPlayerPos(giveplayerid, -2954.6060,2384.6982,3.8054);
               SetPlayerWorldBounds(giveplayerid, 337.5694,101.5826,1940.9759,1798.7453); //285.3481,96.9720,1940.9755,1799.0811
               SetPlayerInterior(giveplayerid,0);
               PlayerInfo[giveplayerid][pInt] = 0;
               format(string, 256, " %s "COL_WHITE"je zatvoren od Admin "COL_RED"%s.", giveplayer, sendername);
               ABroadCast(COLOR_WHITE,string,1);
               format(string, sizeof(string), "Area51 | %s je stavljen u areu od %s-a", giveplayer, sendername);
               printf("%s",string);
              }
         }
         else
         {
             SendClientMessage(playerid, COLOR_GREY, "Igrac je offline!");
             return 1;
         }
       }
       return 1;
   }
   if(strcmp(cmd, "/unprison",true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
           if(PlayerInfo[playerid][pAdmin] < 2)
           {
               SendClientMessage(playerid, WHITE, " Niste ovlasteni da koristite tu komandu .");
               return 1;
           }
           tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /unprison [ID Igraca/Dio Imena]");
            return 1;
         }
         giveplayerid = ReturnUser(tmp);
         if(IsPlayerConnected(giveplayerid))
         {
             if(giveplayerid != INVALID_PLAYER_ID)
             {
                 GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
               GetPlayerName(playerid, sendername, sizeof(sendername));
               format(string, sizeof(string), "* Pustili ste {48E31C}%s-a iz area 51.", giveplayer);
               SendClientMessage(playerid, ZELENKASTA, string);
               format(string, sizeof(string), "* Oslobodio vas je {48E31C}%s "COL_WHITE"iz area 51.", sendername);
               SendClientMessage(giveplayerid, ZELENKASTA, string);
               PlayerInfo[giveplayerid][pJailTime] = 0;
               PlayerInfo[giveplayerid][pJailed] = 0;
               SetPlayerWorldBounds(giveplayerid, 20000.0000,-20000.0000,20000.0000,-20000.0000);
               SetPlayerPos(giveplayerid, 246.8439,70.0776,1003.6406);
               SetPlayerInterior(giveplayerid,6);
               PlayerInfo[giveplayerid][pInt] = 6;
               format(string, 256, " "COL_RED"%s "COL_WHITE"je oslobodjen od strane Admina "COL_RED"%s.", giveplayer, sendername);
               ABroadCast(COLOR_GREY,string,1);
            }
         }
       }
       return 1;
   }
   if(strcmp(cmd, "/jail", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /jail [playerid/PartOfName] [time(minutes)] [reason]");
            return 1;
         }
         new playa;
         new money;
         playa = ReturnUser(tmp);
         tmp = strtok(cmdtext, idx);
         money = strval(tmp);
         if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGameSage] >= 1)
         {
             if(IsPlayerConnected(playa))
             {
                 if(playa != INVALID_PLAYER_ID)
                 {
                    GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                  GetPlayerName(playerid, sendername, sizeof(sendername));
                  new length = strlen(cmdtext);
                  while ((idx < length) && (cmdtext[idx] <= ' '))
                  {
                     idx++;
                  }
                  new offset = idx;
                  new result[128];
                  while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                  {
                     result[idx - offset] = cmdtext[idx];
                     idx++;
                  }
                  result[idx - offset] = EOS;
                  if(!strlen(result))
                  {
                     SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /jail [playerid/PartOfName] [time(minutes)] [reason]");
                     return 1;
                  }
                  format(string, sizeof(string), "*  Zatvorio si "COL_RED"%s.", giveplayer);
                  SendClientMessage(playerid, WHITE, string);
                  format(string, sizeof(string), "*  "COL_RED"%s {FFFFFF}vas je zatvorio u zatvor | Razlog: "COL_RED"%s", sendername, (result));
                  SendClientMessage(playa, WHITE, string);
                  SafeResetPlayerWeapons(playa);
                  WantedPoints[playa] = 0;
                  PlayerInfo[playa][pJailed] = 1;
                  PlayerInfo[playa][pJailTime] = money*60;
                  SetPlayerInterior(playa, 0);
                  PlayerInfo[playa][pInt] = 0;
                  new rand = random(sizeof(gRandomJailSpawns));
                  SetPlayerPos(playa, gRandomJailSpawns[rand][0], gRandomJailSpawns[rand][1], gRandomJailSpawns[rand][2]);
                  format(string, sizeof(string), "Zatvorn si na "COL_RED"%d {FFFFFF}minuta. Jamcevina: "COL_RED"Nedostupna", money);
                  SendClientMessage(playa, COLOR_WHITE, string);
                  format(string, 256, " "COL_RED"%s {FFFFFF}je zatvoren od "COL_RED"%s | {FFFFFF}Razlog: "COL_RED"%s", giveplayer, sendername, (result));
                  ABroadCast(WHITE,string,1);
                  format(string, sizeof(string), "Jail | %s,Admin %s [Razlog: %s]", giveplayer, sendername, (result));
                  printf("%s",string);
               }
            }
         }
         else
         {
            SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
         }
      }
      return 1;
   }