#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <streamer>
#define COLOR_PINK 0xFF66FFAA
#define COLOR_RED 0xFF0000AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIME 0x99FF00AA
#define COLOR_YELLOW 0xFF9900AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xF97804FF
#define COLOR_BLUE 0x33CCFFAA
//Drog azonosítók
#define DROG_NINCS 0
#define DROG_VAN 1
#define DROGY 2
#define DROGN 3
// Checkpoint
new DROGCP, DROGFEL;
// Drog
public OnFilterScriptInit()//Mód esetén \'public OnGameModeInit()\'
{
print(\"Drog System betöltve By.: Gabor...\");
DROGCP = CreateDynamicCP(-1104.8046,-1617.5413,76.3672, 2, -1, -1, -1, 200);
DROGFEL = CreateDynamicCP(-1074.3137,-1625.3157,76.3672, 2, -1, -1, -1, 200);
//Drog map(Vadkender)
CreateDynamicObject(669, -1073.5, -1636.4000244141, 61.700000762939, 0, 0, 0);
CreateDynamicObject(669, -1073.5, -1633.0999755859, 62.400001525879, 0, 0, 90);
CreateDynamicObject(669, -1074.4000244141, -1628.3000488281, 61.900001525879, 0, 0, 90);
CreateDynamicObject(669, -1075.1999511719, -1630.5999755859, 62.700000762939, 0, 0, 174);
CreateDynamicObject(669, -1075.0999755859, -1626.4000244141, 62.700000762939, 0, 0, 169.99597167969);
CreateDynamicObject(669, -1073.8000488281, -1624.3000488281, 62.700000762939, 0, 0, 331.99145507813);
CreateDynamicObject(669, -1073.9000244141, -1620.3000488281, 62.700000762939, 0, 0, 17.990356445313);
CreateDynamicObject(669, -1072.6999511719, -1618.1999511719, 62.700000762939, 0, 0, 343.99011230469);
CreateDynamicObject(669, -1074.9000244141, -1614.4000244141, 62.400001525879, 0, 0, 59.987426757813);
CreateDynamicObject(11090, -1104.4000244141, -1615.8000488281, 75.099998474121, 0, 0, 270);
return 1;
}
public OnGameModeExit()
{
print(\"Drog System kikapcsolva By.: Gabor...\");
return 1;
}
public OnPlayerConnect(playerid)
{
SetPVarInt(playerid, \"Drog\", DROG_NINCS);
SetPVarInt(playerid, \"Felszed\", DROGN);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
SetPVarInt(playerid, \"Drog\", DROG_NINCS);
SetPVarInt(playerid, \"Felszed\", DROGN);
return 1;
}
CMD:drog(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, -1085.9890,-1630.2303,76.3672);
LinkVehicleToInterior(tmpcar, 0);
SetPlayerVirtualWorld(playerid, 0);
}
else SetPlayerPos(playerid, -1085.9890,-1630.2303,76.3672);
return 1;
}
CMD:vkfelszed(playerid, params[])
{
if(GetPVarInt(playerid, \"Drog\") == DROG_NINCS)
{
if(IsPlayerInDynamicCP(playerid, DROGFEL))
{
SetPVarInt(playerid, \"Felszed\", DROGY);
SendClientMessage(playerid, COLOR_LIME, \"Felszedted a vadkendert! Menj a szemben lévõ Checkpointhoz!\");
}
else SendClientMessage(playerid, COLOR_RED, \"Nem vagy a felszedõ checkpointban!\");
}
else SendClientMessage(playerid, COLOR_RED, \"Van már drogod!\");
return 1;
}
CMD:drogcsinal(playerid, params[])
{
if(GetPVarInt(playerid, \"Drog\") == DROG_NINCS)
{
if(GetPVarInt(playerid, \"Felszed\") == DROGY)
{
if(!IsPlayerInDynamicCP(playerid, DROGCP)) return SendClientMessage(playerid, COLOR_RED, \"Nem vagy a checkpointba!\");
SetPVarInt(playerid, \"Drog\", DROG_VAN);
TogglePlayerControllable(playerid, 0);
SetTimerEx(\"drogcsin\",4000,0,\"i\",playerid);
SetTimerEx(\"drogido\",300000,0,\"i\",playerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Drogot készítesz.....\");
}
else SendClientMessage(playerid, COLOR_RED, \"Nem szedtél fel vadkendert!\");
}
else SendClientMessage(playerid, COLOR_RED, \"Ne legyél drogfüggõ, majd 5 perc múlva újra csinálhatsz!\");
return 1;
}
CMD:drogbead(playerid, params[])
{
if(GetPVarInt(playerid, \"Drog\") == DROG_VAN)
{
SetPlayerDrunkLevel(playerid, 50000);
SetPVarInt(playerid, \"Drog\", DROG_NINCS);
SetTimerEx(\"bead\",60000,0,\"i\",playerid);
SendClientMessage(playerid, COLOR_LIME, \"Tyhûûûû... Most aztán jól beszívtál.\");
}
else SendClientMessage(playerid, COLOR_RED, \"Nincs Drogod!\");
return 1;
}
CMD:drogelad(playerid, params[])
{
if(GetPVarInt(playerid, \"Drog\") == DROG_VAN)
{
new
string[128],
name[MAX_PLAYER_NAME],
name2[MAX_PLAYER_NAME],
PID;
if(sscanf(params, \"u\", PID)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /drogelad <ID/Játékos név>\");
if(PID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz ID/Név!\");
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
GetPlayerName(PID, name2, MAX_PLAYER_NAME);
format(string, sizeof(string), \"%s Elakar adni neked drogot $50000-ért, ha megakarod venni, akkor /megvesz <ID>\", name);
SendClientMessage(PID, COLOR_ORANGE, string);
format(string, sizeof(string), \"Elakarsz adni %s-nak/nek drogot!\", name2);
SendClientMessage(playerid, COLOR_ORANGE, string);
}
else SendClientMessage(playerid, COLOR_RED, \"Nincsen drogod!\");
return 1;
}
CMD:drogmegvesz(playerid, params[])
{
if(GetPVarInt(playerid, \"Drog\") == DROG_NINCS)
{
new
string[128],
name[MAX_PLAYER_NAME],
name2[MAX_PLAYER_NAME],
PID;
if(sscanf(params, \"u\", PID)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /drogmegvesz <ID/Játékos név>\");
if(PID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz ID/Név!\");
if(GetPVarInt(PID, \"Drog\") == DROG_NINCS) return SendClientMessage(playerid, COLOR_RED, \"Nincs drog az illetõnél!\");
SetPVarInt(playerid, \"Drog\", DROG_VAN);
SetPVarInt(PID, \"Drog\", DROG_NINCS);
GivePlayerMoney(playerid, -50000);
GivePlayerMoney(PID, 50000);
GetPlayerName(playerid,name, MAX_PLAYER_NAME);
format(string, sizeof(string), \"%s Megvette tõled a drogot!\", name);
SendClientMessage(PID, COLOR_ORANGE, string);
GetPlayerName(PID, name2, MAX_PLAYER_NAME);
format(string, sizeof(string), \"%s-tõl/tól Megvetted a drogot!\", name2);
SendClientMessage(playerid, COLOR_ORANGE, string);
}
else SendClientMessage(playerid, COLOR_RED, \"Van már drogot!\");
return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == DROGCP) return SendClientMessage(playerid, COLOR_WHITE, \"Ha Drogot szeretnél csinálni, akkor /drogcsinal!\");
if(checkpointid == DROGFEL) return SendClientMessage(playerid, COLOR_WHITE, \"Ha felszeretnéd szedni a vadkendert, akkor /vkfelszed \");
return 1;
}
// Drog timerekhez kapcsolódó eljárások
forward bead(playerid);
public bead(playerid)
{
SetPlayerDrunkLevel(playerid, 0);
SendClientMessage(playerid, COLOR_LIME, \"Már nem vagy beszívva, aztán óvatosan a füvezéssel!\");
return 1;
}
forward drogido(playerid);
public drogido(playerid)
{
SetPVarInt(playerid, \"Drog\", DROG_NINCS);
SendClientMessage(playerid, COLOR_BLUE, \"Ember, mostmár újra csinálhatsz drogot.\");
return 1;
}
forward drogcsin(playerid);
public drogcsin(playerid)
{
SetPVarInt(playerid, \"Drog\", DROG_VAN);
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid, COLOR_PINK, \"Csináltál Drogot! Ha eladni akarod, akkor /drogelad, ha elszívni, akkor /drogelbead!\");
return 1;
}
nem én csináltam.