17.09.2009, 02:15
Here I here have written script of drugs:
Like all works, but there is halt:
On idea should be - when you buy Opium or Heroin at тя one dependence, and at мя on the contrary is shown ONLY:
The Heroin dose + the Opium dose + still the Heroin dose = 3 dependences, and should be one (as it can be corrected?
And more here, Lomka is displayed inscriptions "torments you....." "You has released" at all..... But besides that are displayed..... So conditions also are carried out help to correct as it?
Код:
#include <a_samp> #include <xPickup> // This is a comment // uncomment the line below if you want to write a filterscript #define FILTERSCRIPT #define COLOR_RED 0xAA3333AA #define COLOR_YELLOW 0xFFFF00AA #if defined FILTERSCRIPT main() { print("\n----------------------------------"); print("Narko BY Grad[i]ent"); print("----------------------------------\n"); } #endif new Menu:menu1; new drugs; new zavisimost; forward Lomka(playerid); new drugshealth = drugs + 120; new drugsmoney = -500*drugs; new doza; new nark; public OnFilterScriptInit() { nark = 0; menu1 = CreateMenu("Drags", 1, 50.0, 180.0, 200.0, 200.0); AddMenuItem(menu1, 0, "Opiym"); AddMenuItem(menu1, 0, "Geroin"); AddMenuItem(menu1, 0, "narkoSTOP"); return 1; } public OnPlayerSelectedMenuRow(playerid, row) { new Menu:current; current = GetPlayerMenu(playerid); if(current == menu1) { switch(row) { case 0: { TogglePlayerControllable(playerid,1); doza = SetTimer("message", 30000, true); new drugshealth = drugs + 100; new drugsmoney = -500*drugs; SetPlayerHealth(playerid, drugshealth); GivePlayerMoney(playerid, drugsmoney); zavisimost = SetTimer("Lomka",60000 - drugs*1000,1); SetPlayerWeather(playerid, -66); SendClientMessage(playerid, COLOR_YELLOW, " Ты принял дозу ~Опиума~."); nark = 1; HideMenuForPlayer(menu1,playerid); } case 1: { TogglePlayerControllable(playerid,1); doza = SetTimer("message", 30000, true); new drugshealth = drugs + 100; new drugsmoney = -500*drugs; SetPlayerHealth(playerid, drugshealth); GivePlayerMoney(playerid, drugsmoney); zavisimost = SetTimer("Lomka",60000 - drugs*1000,1); SetPlayerWeather(playerid, 777777893); SendClientMessage(playerid, COLOR_YELLOW, " Ты принял дозу ~Героина~."); nark = 1; HideMenuForPlayer(menu1,playerid); } case 2: { TogglePlayerControllable(playerid,1); KillTimer(zavisimost); GivePlayerMoney(playerid, -99000); SetPlayerWeather(playerid, 0); SendClientMessage(playerid, COLOR_YELLOW, " Мы излечили тебя от наркозависимости, с тебя всего $99000"); } } } return 1; } public OnPlayerExitedMenu(playerid) { if(GetPlayerMenu(playerid) == menu1) TogglePlayerControllable(playerid,1); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/drags", true)==0) { if (nark == 1) { SendClientMessage(playerid, COLOR_YELLOW, " Нельзя принимать больше 1й дозы, или лечится во время опьянения!"); return 1; } if (PlayerToPoint(15,playerid,495.8708,-75.0614,998.7578)) { TogglePlayerControllable(playerid, 0); ShowMenuForPlayer(menu1, playerid); return 1; } else { SendClientMessage(playerid, COLOR_YELLOW, " Наркотики можно купить, только в баре `Ten Green Bottles`"); } } return 0; } public message(playerid) { if(30000) { KillTimer(doza); SetPlayerWeather(playerid, 0); SendClientMessage(playerid, COLOR_YELLOW, " Тебя, отпустило."); nark = 0; } } public Lomka(playerid) { new Float:health; GetPlayerHealth(playerid, health); SetPlayerHealth(playerid, health - 4); SendClientMessage(playerid, COLOR_YELLOW, " Ломка мучает тебя,чувак...тебе нужно лечение!"); return 1; }
On idea should be - when you buy Opium or Heroin at тя one dependence, and at мя on the contrary is shown ONLY:
The Heroin dose + the Opium dose + still the Heroin dose = 3 dependences, and should be one (as it can be corrected?
And more here, Lomka is displayed inscriptions "torments you....." "You has released" at all..... But besides that are displayed..... So conditions also are carried out help to correct as it?