[Pomoc] /usedrugs

Započeo MEMOREX™️, Decembar 28, 2011, 22:17:40 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: Moja
Detaljan opis problema: Ovako. Treba mi komanda /usedrugs (Imam je) ali kad ju koristim ugasi mi se Server!.... A ako mi mozete uraditi novi ili ja vise nezzzzzznaam. Vec me nervira ova komanda pa zato pitam pomoc...... Znaci komada Radi +5 hp. promeni weather na -68 pa -2 drugs i pise TajI Taj Koristi drogu (u kololini)... i to je to...
Dio skripte:

if(strcmp(cmd, "/usedrugs", true) == 0)
{
  if(PlayerInfo[playerid][pDrugs] >= 2)
  {
  if(PlayerInfo[playerid][pDrogaTime] == 0)
  {
           PlayerInfo[playerid][pDrugs] -=2;
           new Float:HP;
           GetPlayerHealth(playerid, HP);
           SetPlayerHealth(playerid, HP+5);
           GetPlayerName(playerid, sendername, sizeof(sendername));
   format(string, sizeof(string), "* Igrac %s vadi te koristi drogu.", sendername);
   ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
           PlayerInfo[playerid][pDrogaTime] = 1;
           SetTimerEx("DrugEffectGone", 5000, false, "%d", playerid);
       }
       else
{
SendClientMessage(playerid,COLOR_LIGHTRED, "ERROR: Morate pricekati pet sekundi prije ponovnog koristenja droge.");
}
}
else
{
SendClientMessage(playerid,COLOR_LIGHTRED, "ERROR: Nemozete koristiti ovu komandu - nemate droge.");
}
return 1;
}
Neke slike/video za lakse dobivanje pomoci(neobavezno):
Poslednja Izmena: Decembar 28, 2011, 22:18:11 POSLE PODNE od Memorexâ„¢
Skriptam za pare

Evo ti /usedrugs treba da ti radi
if(strcmp(cmd, "/usedrugs", true) == 0) // Drug system by MasteR
{
   if(IsPlayerConnected(playerid))
   {
       if(PlayerBoxing[playerid] > 0)
       {
           SendClientMessage(playerid, COLOR_GREY, "   Ne mozete se drogirati dok letite !");
           return 1;
       }
       if(UsingDrugs[playerid] == 1)
       {
           SendClientMessage(playerid, COLOR_WHITE, "   Vec ste drogirani !");
           return 1;
       }
       new x_nr[256];
       x_nr = strtok(cmdtext, idx);
       if(!strlen(x_nr))
       {
           SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /usedrugs [ime]");
           SendClientMessage(playerid, COLOR_WHITE, "Available names: weed, heroin");
           return 1;
       }
       if(strcmp(x_nr,"weed",true) == 0)
       {
           if(PlayerInfo[playerid][pDrugs] > 3)
           {
               PlayerStoned[playerid] += 1;
               if(PlayerStoned[playerid] >= 3) { GameTextForPlayer(playerid, "~w~Vi ste~n~~p~Naduvani", 4000, 1); }
               new Float:PlayersArmour;
               GetPlayerArmour(playerid, PlayersArmour);
               if(PlayerInfo[playerid][pDrugPerk] > 0)
    {
        SetPlayerArmour(playerid, PlayersArmour + 100.0);
    }
    PlayerInfo[playerid][pDrugs] -= 3;
    SetPlayerArmour(playerid, PlayersArmour + 100.0);
    SetPlayerWeather(playerid, -68);
    UsingDrugs[playerid] = 1;
    SetTimerEx("DrugEffectGone", 25000, false, "i", playerid);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "* %s uzima malo vutre iz dzepa i pocinje pusiti.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    ApplyAnimation(playerid,"SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, 0);
    if(STDPlayer[playerid]==1)
{
    STDPlayer[playerid] = 0;
    SendClientMessage(playerid, COLOR_WHITE, "* Niste vise zarazeni sa STD zbog droge !");
}
else if(STDPlayer[playerid]==2)
{
    STDPlayer[playerid] = 1;
    SendClientMessage(playerid, COLOR_WHITE, "* You lowered the STD to Chlamydia because of the Drugs !");
}
else if(STDPlayer[playerid]==3)
{
    STDPlayer[playerid] = 2;
    SendClientMessage(playerid, COLOR_WHITE, "* You lowered the STD to Gonorrhea because of the Drugs !");
}
           }
           else
           {
               SendClientMessage(playerid, COLOR_GREY, "   Nemate vise droge !");
           }
       }
       else if(strcmp(x_nr,"heroin",true) == 0)
       {
           if(PlayerInfo[playerid][pDrugs] > 3)
           {
               PlayerStoned[playerid] += 1;
               if(PlayerStoned[playerid] >= 3) { GameTextForPlayer(playerid, "~w~Vi ste~n~~p~Drogirani", 4000, 1); }
               new Float:PlayersArmour;
               GetPlayerArmour(playerid, PlayersArmour);
               if(PlayerInfo[playerid][pDrugPerk] > 0)
    {
        SetPlayerArmour(playerid, PlayersArmour + 100.0);
    }
    PlayerInfo[playerid][pDrugs] -= 3;
    SetPlayerArmour(playerid, PlayersArmour + 100.0);
    SetPlayerWeather(playerid, -30);
    UsingDrugs[playerid] = 1;
    SetTimerEx("DrugEffectGone", 25000, false, "i", playerid);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "* %s uzima heroin.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
    if(STDPlayer[playerid]==1)
{
    STDPlayer[playerid] = 0;
    SendClientMessage(playerid, COLOR_WHITE, "* Niste vise zarazeni sa STD zbog droge !");
}
else if(STDPlayer[playerid]==2)
{
    STDPlayer[playerid] = 1;
    SendClientMessage(playerid, COLOR_WHITE, "* You lowered the STD to Chlamydia because of the Drugs !");
}
else if(STDPlayer[playerid]==3)
{
    STDPlayer[playerid] = 2;
    SendClientMessage(playerid, COLOR_WHITE, "* You lowered the STD to Gonorrhea because of the Drugs !");
}
           }
           else
           {
               SendClientMessage(playerid, COLOR_GREY, "   Nemate vise droge !");
           }
       }
       else
       {
           SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /usedrugs [ime]");
           SendClientMessage(playerid, COLOR_WHITE, "Availible names: weed, heroin");
}
   }
   return 1;
}
Poslednja Izmena: Decembar 28, 2011, 23:20:01 POSLE PODNE od (BSL)MasteR
Balkan Online Public CS 1.6
IP:188.40.52.207:27027
Forum: www.cs-balkanonline.site40.net
Posjetite nas......

Citat: (BSL)MasteR poslato Decembar 28, 2011, 23:17:20 POSLE PODNE
Evo ti /usedrugs treba da ti radi
if(strcmp(cmd, "/usedrugs", true) == 0) // Drug system by MasteR
{
   if(IsPlayerConnected(playerid))
   {
       if(PlayerBoxing[playerid] > 0)
       {
           SendClientMessage(playerid, COLOR_GREY, "   Ne mozete se drogirati dok letite !");
           return 1;
       }
       if(UsingDrugs[playerid] == 1)
       {
           SendClientMessage(playerid, COLOR_WHITE, "   Vec ste drogirani !");
           return 1;
       }
       new x_nr[256];
       x_nr = strtok(cmdtext, idx);
       if(!strlen(x_nr))
       {
           SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /usedrugs [ime]");
           SendClientMessage(playerid, COLOR_WHITE, "Available names: weed, heroin");
           return 1;
       }
       if(strcmp(x_nr,"weed",true) == 0)
       {
           if(PlayerInfo[playerid][pDrugs] > 3)
           {
               PlayerStoned[playerid] += 1;
               if(PlayerStoned[playerid] >= 3) { GameTextForPlayer(playerid, "~w~Vi ste~n~~p~Naduvani", 4000, 1); }
               new Float:PlayersArmour;
               GetPlayerArmour(playerid, PlayersArmour);
               if(PlayerInfo[playerid][pDrugPerk] > 0)
    {
        SetPlayerArmour(playerid, PlayersArmour + 100.0);
    }
    PlayerInfo[playerid][pDrugs] -= 3;
    SetPlayerArmour(playerid, PlayersArmour + 100.0);
    SetPlayerWeather(playerid, -68);
    UsingDrugs[playerid] = 1;
    SetTimerEx("DrugEffectGone", 25000, false, "i", playerid);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "* %s uzima malo vutre iz dzepa i pocinje pusiti.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    ApplyAnimation(playerid,"SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, 0);
    if(STDPlayer[playerid]==1)
{
    STDPlayer[playerid] = 0;
    SendClientMessage(playerid, COLOR_WHITE, "* Niste vise zarazeni sa STD zbog droge !");
}
else if(STDPlayer[playerid]==2)
{
    STDPlayer[playerid] = 1;
    SendClientMessage(playerid, COLOR_WHITE, "* You lowered the STD to Chlamydia because of the Drugs !");
}
else if(STDPlayer[playerid]==3)
{
    STDPlayer[playerid] = 2;
    SendClientMessage(playerid, COLOR_WHITE, "* You lowered the STD to Gonorrhea because of the Drugs !");
}
           }
           else
           {
               SendClientMessage(playerid, COLOR_GREY, "   Nemate vise droge !");
           }
       }
       else if(strcmp(x_nr,"heroin",true) == 0)
       {
           if(PlayerInfo[playerid][pDrugs] > 3)
           {
               PlayerStoned[playerid] += 1;
               if(PlayerStoned[playerid] >= 3) { GameTextForPlayer(playerid, "~w~Vi ste~n~~p~Drogirani", 4000, 1); }
               new Float:PlayersArmour;
               GetPlayerArmour(playerid, PlayersArmour);
               if(PlayerInfo[playerid][pDrugPerk] > 0)
    {
        SetPlayerArmour(playerid, PlayersArmour + 100.0);
    }
    PlayerInfo[playerid][pDrugs] -= 3;
    SetPlayerArmour(playerid, PlayersArmour + 100.0);
    SetPlayerWeather(playerid, -30);
    UsingDrugs[playerid] = 1;
    SetTimerEx("DrugEffectGone", 25000, false, "i", playerid);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "* %s uzima heroin.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
    if(STDPlayer[playerid]==1)
{
    STDPlayer[playerid] = 0;
    SendClientMessage(playerid, COLOR_WHITE, "* Niste vise zarazeni sa STD zbog droge !");
}
else if(STDPlayer[playerid]==2)
{
    STDPlayer[playerid] = 1;
    SendClientMessage(playerid, COLOR_WHITE, "* You lowered the STD to Chlamydia because of the Drugs !");
}
else if(STDPlayer[playerid]==3)
{
    STDPlayer[playerid] = 2;
    SendClientMessage(playerid, COLOR_WHITE, "* You lowered the STD to Gonorrhea because of the Drugs !");
}
           }
           else
           {
               SendClientMessage(playerid, COLOR_GREY, "   Nemate vise droge !");
           }
       }
       else
       {
           SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /usedrugs [ime]");
           SendClientMessage(playerid, COLOR_WHITE, "Availible names: weed, heroin");
}
   }
   return 1;
}


Hvala. Ali meni treba jednostavan. da nema ni weed ni heroin. samo /usedrugs i da mu doda Hp a ne Armour :) .. Ali Hvala za Trud. :)
Skriptam za pare

Mr.Gagi

if(strcmp(cmd, "/usedrugs", true) == 0) 
   { 
      if(PlayerInfo[playerid][pDrugs] >= 2) 
      { 
      if(PlayerInfo[playerid][pDrogaTime] == 0) 
      { 
            PlayerInfo[playerid][pDrugs] -=2; 
            new Float:HP; 
            GetPlayerHealth(playerid, HP); 
            SetPlayerHealth(playerid, HP+5); 
            GetPlayerName(playerid, sendername, sizeof(sendername)); 
       format(string, sizeof(string), "* Igrac %s vadi te koristi drogu.", sendername); 
       ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
            PlayerInfo[playerid][pDrogaTime] = 1; 
            SetTimerEx("DrugEffectGone", 5000, false, "d", playerid); 
        } 
        else 
      { 
      SendClientMessage(playerid,COLOR_LIGHTRED, "ERROR: Morate pricekati pet sekundi prije ponovnog koristenja droge."); 
      } 
      } 
      else 
      { 
      SendClientMessage(playerid,COLOR_LIGHTRED, "ERROR: Nemozete koristiti ovu komandu - nemate droge."); 
      } 
      return 1; 
   } 

Aj probaj ovako.