Üdv, próbáltam összehozni egy olyan szkriptet aminek hasznát vehetitek, így elkészítettem az elsõ munkaszkriptem. Munkák: Rendõr, Mentõs, Taxis, Pizzafutár, Úttisztító, Autószerelõ
Parancsok:
/sokkol - Lefagyasztja a játékost 3 másodpercre
/lecsuk - Játékos bezárása a börtönbe (textdraw mutatása arról hogy hány másodperc van még hátra)
/gyogyit - Feltölti a játékos életét (nem tudtam hogy tudnám \"különlegessé\" tenni..ötleteket várok.^^)
/javit - Megjavítja a játékos jármûvét (szintén)
/pizza - Pizza kiszállítás
/uttisztitas - Megjelenõ CP-ken kell haladni
/szallit - Utas szállításLetöltés: http://www.solidfiles.com/d/b18a0a679e/
#include < a_samp >
#include < sscanf2 >
#include < zcmd >
#include < fixchars >
#define RENDOR 0
#define MENTO 1
#define UTTISZTITO 2
#define PIZZAFUTAR 3
#define AUTOSZERELO 4
#define TAXI 5
#define NINCS 6
#define PIROS 0xeb1717AA
#define KEK 0x17e0ebAA
#define ZOLD 0x17eb29AA
#define NARANCS 0xeda023AA
#define BARNA 0x822d2dAA
#define SARGA 0xe6e03aAA
new munka[MAX_PLAYERS];
#define MUNKAK 1234
main() { }
new Float:rendelesek[5][3] =
{
{2484.2205,920.6072,10.7105},
{2486.9875,1531.7740,10.7085},
{1015.4446,1841.9604,10.6994},
{1344.9720,2596.9402,10.4032},
{2614.3760,2212.8931,10.3949}
};
new Float:utasfelvetel[22][3] =
{
{2160.3320,2055.4702,10.5661},
{2159.6953,1957.0100,10.5673},
{2132.7607,1810.3250,10.5675},
{2079.7021,1619.3785,10.5694},
{2080.7549,1455.5938,10.5675},
{2079.9414,1294.9775,10.5674},
{2079.6921,1135.5769,10.5677},
{2080.3665,1002.0613,10.5646},
{2035.4452,913.5845,8.4233},
{2034.9277,1016.3568,10.5671},
{2034.3649,1177.5657,10.5672},
{2033.9302,1353.3966,10.5670},
{2034.4137,1620.3201,10.5668},
{2082.8086,1799.7281,10.5676},
{2029.4786,1915.2919,12.0698},
{2114.8093,2037.2749,10.5602},
{1939.4149,2107.6467,10.4895},
{1873.4940,2055.2214,10.5670},
{1623.8896,2045.3334,10.4712},
{1610.8477,2153.2747,10.5670},
{1733.3638,2210.6692,10.5669},
{1651.9015,2265.7212,10.5672}
};
new Float:utasletetel[11][3] =
{
{2061.7883,2651.5706,10.5657},
{2061.1472,2734.6421,10.5671},
{1986.2473,2734.1816,10.5674},
{1821.3400,2720.2749,10.5672},
{1627.8623,2740.3684,10.5672},
{1499.7968,2803.2471,10.5667},
{1629.5864,2829.2522,10.5673},
{1726.3871,2706.6992,10.5674},
{1773.7991,2706.4480,10.5674},
{1946.9113,2735.6951,10.5655},
{2145.4028,2766.4771,10.5644}
};
enum jarmuvek
{
autoszerelo[3],
mento[3],
pizzafutar[2],
taxi[3],
uttisztito[3],
rendor[4]
};
new kocsik[jarmuvek];
new cp[MAX_PLAYERS];
new bool:frakckocsiban[MAX_PLAYERS];
new bool:pizzacp[MAX_PLAYERS];
new bool:szallitas[MAX_PLAYERS];
new pizzatimer[MAX_PLAYERS];
new utasszallitas[MAX_PLAYERS];
new bortonido[MAX_PLAYERS];
new leteltido[MAX_PLAYERS];
new bortonszamlalo[MAX_PLAYERS];
new bool:bortonben[MAX_PLAYERS];
new Text:bortontd[MAX_PLAYERS];
public OnFilterScriptInit()
{
print(\"Munka Szkript betöltve! by: DaWee\");
//Kocsik
kocsik[autoszerelo][0] = AddStaticVehicle(525,2393.0107,1015.2910,10.7069,125.2092,0,0); // autószerelõkocsi
kocsik[autoszerelo][1] = AddStaticVehicle(525,2393.3523,1008.0689,10.7019,128.7392,0,0); // autószerelõkocsi
kocsik[autoszerelo][2] = AddStaticVehicle(525,2393.4407,1000.3688,10.7105,129.8539,0,0); // autószerelõkocsi
kocsik[mento][0] = AddStaticVehicle(416,1594.7666,1849.8314,10.9688,178.0924,1,6); // mentõ
kocsik[mento][1] = AddStaticVehicle(416,1601.1036,1849.5844,10.9693,179.7100,1,6); // mentõ
kocsik[mento][2] = AddStaticVehicle(416,1607.6207,1849.4182,10.9697,180.1315,1,6); // mentõ
kocsik[pizzafutar][0] = AddStaticVehicle(448,2086.0764,2205.1519,10.4185,358.5762,3,3); // pizzafutár
kocsik[pizzafutar][1] = AddStaticVehicle(448,2083.1633,2205.2156,10.4195,357.6584,3,3); // pizzafutár
kocsik[taxi][0] = AddStaticVehicle(420,1527.8209,2214.5715,10.6004,359.8884,6,6); // taxi
kocsik[taxi][1] = AddStaticVehicle(420,1534.5490,2214.2957,10.5979,359.7014,6,6); // taxi
kocsik[taxi][2] = AddStaticVehicle(420,1541.2281,2214.2615,10.5990,1.1591,6,6); // taxi
kocsik[uttisztito][0] = AddStaticVehicle(574,1671.3323,988.5707,10.5455,179.4893,2,2); // úttisztító
kocsik[uttisztito][1] = AddStaticVehicle(574,1677.7534,988.5708,10.5455,179.4019,2,2); // úttisztító
kocsik[uttisztito][2] = AddStaticVehicle(574,1665.0098,988.6097,10.5455,178.6767,2,2); // úttisztító
kocsik[rendor][0] = AddStaticVehicle(598,2296.1941,2427.6025,10.5677,155.5798,103,0); // rendõr
kocsik[rendor][1] = AddStaticVehicle(598,2281.6145,2425.2021,10.5680,206.2945,103,0); // rendõr
kocsik[rendor][2] = AddStaticVehicle(598,2273.6096,2425.1809,10.5714,198.7128,103,0); // rendõr
kocsik[rendor][3] = AddStaticVehicle(598,2301.2061,2425.7881,10.5649,149.2544,103,0); // rendõr
return 1;
}
public OnFilterScriptExit()
{
DestroyVehicle(kocsik[autoszerelo][0]);
DestroyVehicle(kocsik[autoszerelo][1]);
DestroyVehicle(kocsik[autoszerelo][2]);
DestroyVehicle(kocsik[mento][0]);
DestroyVehicle(kocsik[mento][1]);
DestroyVehicle(kocsik[mento][2]);
DestroyVehicle(kocsik[pizzafutar][0]);
DestroyVehicle(kocsik[pizzafutar][1]);
DestroyVehicle(kocsik[taxi][0]);
DestroyVehicle(kocsik[taxi][1]);
DestroyVehicle(kocsik[taxi][2]);
DestroyVehicle(kocsik[uttisztito][0]);
DestroyVehicle(kocsik[uttisztito][1]);
DestroyVehicle(kocsik[uttisztito][2]);
DestroyVehicle(kocsik[rendor][0]);
DestroyVehicle(kocsik[rendor][1]);
DestroyVehicle(kocsik[rendor][2]);
DestroyVehicle(kocsik[rendor][3]);
return 1;
}
public OnPlayerConnect(playerid)
{
munka[playerid] = NINCS;
frakckocsiban[playerid] = false;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(munka[playerid] == RENDOR)
{
SetPlayerPos(playerid, 2289.1575,2427.6248,10.8203);
SetPlayerSkin(playerid, 283);
}
else if(munka[playerid] == MENTO)
{
SetPlayerPos(playerid, 1604.5712,1824.0358,10.8203);
SetPlayerSkin(playerid, 276);
}
else if(munka[playerid] == UTTISZTITO)
{
SetPlayerPos(playerid, 1656.1990,994.3511,10.8203);
SetPlayerSkin(playerid, 144);
}
else if(munka[playerid] == TAXI)
{
SetPlayerPos(playerid, 1530.8282,2208.0488,11.2393);
SetPlayerSkin(playerid, 255);
}
else if(munka[playerid] == AUTOSZERELO)
{
SetPlayerPos(playerid, 2393.4819,988.5132,10.8203);
SetPlayerSkin(playerid, 50);
}
else if(munka[playerid] == PIZZAFUTAR)
{
SetPlayerPos(playerid, 2083.1091,2220.4846,10.8203);
SetPlayerSkin(playerid, 155);
}
return 1;
}
CMD:parancsok(playerid)
{
if(munka[playerid] == NINCS) return SendClientMessage(playerid, PIROS, \"Nincs munkád.. /job\");
if(munka[playerid] == RENDOR)
{
SendClientMessage(playerid, ZOLD, \"/sokkol /lecsuk\");
}
if(munka[playerid] == MENTO)
{
SendClientMessage(playerid, ZOLD, \"/gyogyit\");
}
if(munka[playerid] == UTTISZTITO)
{
SendClientMessage(playerid, ZOLD, \"/tisztit\");
}
if(munka[playerid] == PIZZAFUTAR)
{
SendClientMessage(playerid, ZOLD, \"/pizza\");
}
if(munka[playerid] == AUTOSZERELO)
{
SendClientMessage(playerid, ZOLD, \"/javit\");
}
if(munka[playerid] == TAXI)
{
SendClientMessage(playerid, ZOLD, \"/szallit\");
}
return 1;
}
CMD:job(playerid)
{
if(munka[playerid] != NINCS) return SendClientMessage(playerid, PIROS, \"Már van munkád..Kilépéshez /qjob\");
ShowPlayerDialog(playerid, 1234, DIALOG_STYLE_LIST, \"Választható munkák\", \"Rendõr\\nMentõs\\nÚttisztító\\nPizzafutár\\nAutószerelõ\\nTaxis\", \"Választ\", \"Kilép\");
return 1;
}
CMD:qjob(playerid)
{
if(munka[playerid] != NINCS)
{
munka[playerid] = NINCS;
SpawnPlayer(playerid);
SendClientMessage(playerid, NARANCS, \"Kiléptél a munkádból. /job munkavállaláshoz\");
} else {
SendClientMessage(playerid, PIROS, \"Nincs munkád..\");
}
return 1;
}
CMD:sokkol(playerid, params[])
{
munka[playerid] = RENDOR;
new giveplayerid;
new giveplayername[24];
new str[128];
new Float:givepos[3], Float:pos[3];
if(munka[playerid] != RENDOR) return SendClientMessage(playerid, PIROS, \"Nem vagy rendõr!\");
if(sscanf(params, \"u\", giveplayerid)) return 1;
GetPlayerPos(giveplayerid, givepos[0], givepos[1], givepos[2]);
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerName(giveplayerid, giveplayername, 24);
if(giveplayerid == playerid) return SendClientMessage(playerid, PIROS, \"Magadat nem tudod sokkolni!\");
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, PIROS, \"Érvénytelen ID!\");
if(!IsPlayerInRangeOfPoint(playerid, 2, givepos[0], givepos[1], givepos[2])) return SendClientMessage(playerid, PIROS, \"Nincs a közeledben a játékos!\");
TogglePlayerControllable(giveplayerid, 0);
SetTimerEx(\"sokk\", 3000, false, \"i\", giveplayerid);
SendClientMessage(giveplayerid, KEK, \"Lesokkoltak 3 másodpercre.\");
format(str, 128, \"Lesokkoltad %s-t.\", giveplayername);
SendClientMessage(playerid, KEK, str);
return 1;
}
forward sokk(playerid);
public sokk(playerid)
{
TogglePlayerControllable(playerid, 1);
return 1;
}
CMD:lecsuk(playerid, params[])
{
new giveplayerid;
new giveplayername[24];
new str[128];
new ido;
new Float:givepos[3];
if(munka[playerid] != RENDOR) return SendClientMessage(playerid, PIROS, \"Nem vagy rendõr!\");
if(sscanf(params, \"ui\", giveplayerid, ido)) return 1;
GetPlayerName(giveplayerid, giveplayername, 24);
GetPlayerPos(giveplayerid, givepos[0], givepos[1], givepos[2]);
//if(giveplayerid == playerid) return SendClientMessage(playerid, PIROS, \"Magadat nem csukhatod le!\");
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, PIROS, \"Érvénytelen ID!\");
if(!IsPlayerInRangeOfPoint(playerid, 4, 2292.7271,2468.4524,10.8203)) return SendClientMessage(playerid, PIROS, \"Nem vagy a rendõrségnél! (Térképen jelezve!)\"), SetPlayerCheckpoint(playerid, 2292.7271,2468.4524,10.8203, 4);
if(!IsPlayerInRangeOfPoint(playerid, 3, givepos[0], givepos[1], givepos[2])) return SendClientMessage(playerid, PIROS, \"Nincs közeledben a játékos!\");
SetPlayerPos(giveplayerid, 264.7567,77.5803,1001.0391);
SetPlayerInterior(giveplayerid, 6);
SetPlayerVirtualWorld(giveplayerid, 1);
SetTimerEx(\"borton\", ido*60000, false, \"i\", giveplayerid);
format(str, 128, \"Lecsuktad %s-t %d percre.\", giveplayername, ido);
SendClientMessage(playerid, KEK, str);
format(str, 128, \"Lecsuktak %d percre.\", ido);
SendClientMessage(giveplayerid, KEK, str);
bortonben[giveplayerid] = true;
bortontd[giveplayerid] = TextDrawCreate(390, 100, \" \");
TextDrawFont(bortontd[giveplayerid], 1);
TextDrawColor(bortontd[giveplayerid], 0xFFFFFFAA);
TextDrawUseBox(bortontd[giveplayerid], 1);
TextDrawBoxColor(bortontd[giveplayerid], 0x000000FF);
TextDrawShowForPlayer(giveplayerid, bortontd[giveplayerid]);
bortonszamlalo[giveplayerid] = SetTimerEx(\"jailcount\", 1000, true, \"i\", giveplayerid);
bortonido[giveplayerid] = ido*60000;
leteltido[giveplayerid] = 0;
return 1;
}
forward borton(playerid);
public borton(playerid)
{
SetPlayerPos(playerid, 2288.0120,2427.6833,10.8203);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SendClientMessage(playerid, NARANCS, \"Letöltötted a büntetésed.\");
KillTimer(bortonszamlalo[playerid]);
bortonido[playerid] = 0;
leteltido[playerid] = 0;
TextDrawDestroy(bortontd[playerid]);
bortonben[playerid] = false;
return 1;
}
forward jailcount(playerid);
public jailcount(playerid)
{
leteltido[playerid] = leteltido[playerid]+1000;
}
CMD:gyogyit(playerid, params[])
{
new giveplayerid;
new giveplayername[24];
new str[128];
new Float:givepos[3];
if(munka[playerid] != MENTO) return SendClientMessage(playerid, PIROS, \"Nem vagy mentõs!\");
if(sscanf(params, \"u\", giveplayerid)) return 1;
GetPlayerPos(giveplayerid, givepos[0], givepos[1], givepos[2]);
GetPlayerName(giveplayerid, giveplayername, 24);
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, PIROS, \"Érvénytelen ID!\");
if(!IsPlayerInRangeOfPoint(playerid, 2, givepos[0], givepos[1], givepos[2])) return SendClientMessage(playerid, PIROS, \"Nincs a közeledben a játékos!\");
SetPlayerHealth(giveplayerid, 100);
format(str, 128, \"Meggógyítottad %s-t.\", giveplayername);
SendClientMessage(playerid, KEK, str);
SendClientMessage(giveplayerid, KEK, \"Feltöltötték az életed.\");
return 1;
}
CMD:tisztit(playerid)
{
if(munka[playerid] != UTTISZTITO) return SendClientMessage(playerid, PIROS, \"Nem vagy úttisztító!\");
if(GetPlayerVehicleID(playerid) != kocsik[uttisztito][0] && GetPlayerVehicleID(playerid) != kocsik[uttisztito][1] && GetPlayerVehicleID(playerid) != kocsik[uttisztito][2]) return SendClientMessage(playerid, PIROS, \"Úttisztító autóban kell ülnöd!\");
SetPlayerRaceCheckpoint(playerid, 0, 1668.2045,944.8555,10.7660, 1577.9547,932.7616,10.7853, 3);
SendClientMessage(playerid, ZOLD, \"Úttisztítás elkezdve! Menj végig a Checkpointokon hogy megkapd a fizetést.\");
cp[playerid] = 0;
frakckocsiban[playerid] = true;
return 1;
}
CMD:javit(playerid, params[])
{
new giveplayerid;
new giveplayername[24];
new str[128];
new Float:givepos[3];
if(munka[playerid] != AUTOSZERELO) return SendClientMessage(playerid, PIROS, \"Nem vagy autószerelõ!\");
if(sscanf(params, \"u\", giveplayerid)) return 1;
GetPlayerName(giveplayerid, giveplayername, 24);
GetPlayerPos(giveplayerid, givepos[0], givepos[1], givepos[2]);
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, PIROS, \"Érvénytelen ID!\");
if(!IsPlayerInRangeOfPoint(playerid, 4, givepos[0], givepos[1], givepos[2])) return SendClientMessage(playerid, PIROS, \"Nincs közeledben a játékos!\");
if(!IsPlayerInAnyVehicle(giveplayerid)) return SendClientMessage(playerid, PIROS, \"A játékos nem ül jármûben!\");
RepairVehicle(GetPlayerVehicleID(giveplayerid));
format(str, 128, \"Megjavítottad %s jármûvét!\", giveplayername);
SendClientMessage(playerid, KEK, str);
SendClientMessage(giveplayerid, KEK, \"Megjavították a jármûvedet!\");
return 1;
}
CMD:pizza(playerid)
{
if(GetPlayerVehicleID(playerid) != kocsik[pizzafutar][0] && GetPlayerVehicleID(playerid) != kocsik[pizzafutar][1]) return SendClientMessage(playerid, PIROS, \"Szálj fel egy pizzás motorra.\");
if(munka[playerid] != PIZZAFUTAR) return SendClientMessage(playerid, PIROS, \"Nem vagy pizzafutár!\");
if(szallitas[playerid] == true) return SendClientMessage(playerid, PIROS, \"Már vittél ki pizzát az elmúlt 5 percben, próbáld meg késõbb!\");
new rnd = random(sizeof(rendelesek));
SetPlayerCheckpoint(playerid, rendelesek[rnd][0], rendelesek[rnd][1], rendelesek[rnd][2], 3);
SendClientMessage(playerid, ZOLD, \"Elfogadtál egy megrendelést..Menj és vidd ki a pizzát!\");
pizzatimer[playerid] = SetTimer(\"pizzarendeles\", 5*60000, false);
szallitas[playerid] = true;
pizzacp[playerid] = true;
frakckocsiban[playerid] = true;
return 1;
}
CMD:szallit(playerid)
{
new rnd = random(sizeof(utasfelvetel));
if(munka[playerid] != TAXI) return SendClientMessage(playerid, PIROS, \"Nem vagy taxis!\");
if(GetPlayerVehicleID(playerid) != kocsik[taxi][0] && GetPlayerVehicleID(playerid) != kocsik[taxi][1] && GetPlayerVehicleID(playerid) != kocsik[taxi][2]) return SendClientMessage(playerid, PIROS, \"Nem ülsz taxiban!\");
SetPlayerCheckpoint(playerid, utasfelvetel[rnd][0], utasfelvetel[rnd][1], utasfelvetel[rnd][2], 3);
SendClientMessage(playerid, ZOLD, \"Fogadtál egy hívást, menj és vedd fel az utast!\");
frakckocsiban[playerid] = true;
utasszallitas[playerid] = 1;
return 1;
}
forward pizzarendeles(playerid);
public pizzarendeles(playerid)
{
szallitas[playerid] = false;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
new bevetel = randomex(30000, 40000);
new str[128];
switch(cp[playerid])
{
case 0: SetPlayerRaceCheckpoint(playerid, 0, 1577.9547,932.7616,10.7853, 1485.2031,1133.2733,10.7773, 3), cp[playerid]++;
case 1: SetPlayerRaceCheckpoint(playerid, 0, 1485.2031,1133.2733,10.7773, 1007.4518,1211.8536,10.7752, 3), cp[playerid]++;
case 2: SetPlayerRaceCheckpoint(playerid, 0, 1007.4518,1211.8536,10.7752, 1025.8379,1373.2275,10.9509, 3), cp[playerid]++;
case 3: SetPlayerRaceCheckpoint(playerid, 0, 1025.8379,1373.2275,10.9509, 1167.4708,1401.9779,8.5918, 3), cp[playerid]++;
case 4: SetPlayerRaceCheckpoint(playerid, 0, 1167.4708,1401.9779,8.5918, 1163.4192,1664.6498,5.8791, 3), cp[playerid]++;
case 5: SetPlayerRaceCheckpoint(playerid, 0, 1163.4192,1664.6498,5.8791, 1029.4604,1659.2610,5.9229, 3), cp[playerid]++;
case 6: SetPlayerRaceCheckpoint(playerid, 0, 1029.4604,1659.2610,5.9229, 1007.2145,1359.7057,10.7738, 3), cp[playerid]++;
case 7: SetPlayerRaceCheckpoint(playerid, 0, 1007.2145,1359.7057,10.7738, 1091.2129,1193.9396,10.7752, 3), cp[playerid]++;
case 8: SetPlayerRaceCheckpoint(playerid, 0, 1091.2129,1193.9396,10.7752, 1447.2891,1169.1223,10.7757, 3), cp[playerid]++;
case 9: SetPlayerRaceCheckpoint(playerid, 0, 1447.2891,1169.1223,10.7757, 1741.6011,1132.9407,11.0800, 3), cp[playerid]++;
case 10: SetPlayerRaceCheckpoint(playerid, 0, 1741.6011,1132.9407,11.0800, 1868.0763,1061.5563,10.7757, 3), cp[playerid]++;
case 11: SetPlayerRaceCheckpoint(playerid, 0, 1868.0763,1061.5563,10.7757, 2048.4185,901.5236,7.9988, 3), cp[playerid]++;
case 12: SetPlayerRaceCheckpoint(playerid, 0, 2048.4185,901.5236,7.9988, 1829.9387,852.0641,10.3685, 3), cp[playerid]++;
case 13: SetPlayerRaceCheckpoint(playerid, 0, 1829.9387,852.0641,10.3685, 1348.5858,776.3357,10.8763, 3), cp[playerid]++;
case 14: SetPlayerRaceCheckpoint(playerid, 0, 1348.5858,776.3357,10.8763, 1567.3180,704.7684,10.8009, 3), cp[playerid]++;
case 15: SetPlayerRaceCheckpoint(playerid, 0, 1567.3180,704.7684,10.8009, 1694.9191,986.5135,10.9232, 3), cp[playerid]++;
case 16: SetPlayerRaceCheckpoint(playerid, 1, 1694.9191,986.5135,10.9232, 0,0,0, 3), cp[playerid]++;
case 17: cp[playerid] = -1, frakckocsiban[playerid] = false, DisablePlayerRaceCheckpoint(playerid),
format(str, 128, \"Megtisztítottad az utat. Bevétel: %d\", bevetel), SendClientMessage(playerid, KEK, str), GivePlayerMoney(playerid, bevetel);
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(frakckocsiban[playerid] == true)
{
if(munka[playerid] == UTTISZTITO)
{
frakckocsiban[playerid] = false;
DisablePlayerRaceCheckpoint(playerid);
cp[playerid] = 0;
SendClientMessage(playerid, BARNA, \"Kiszáltál az úttisztító autóból, a munkád véget ért.\");
}
else if(munka[playerid] == PIZZAFUTAR)
{
frakckocsiban[playerid] = false;
DisablePlayerCheckpoint(playerid);
KillTimer(pizzatimer[playerid]);
SendClientMessage(playerid, BARNA, \"Leszáltál az pizzás motorról, a munkád véget ért.\");
}
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetPlayerVehicleID(playerid) == kocsik[autoszerelo][0] || GetPlayerVehicleID(playerid) == kocsik[autoszerelo][1] || GetPlayerVehicleID(playerid) == kocsik[autoszerelo][2])
{
if(munka[playerid] != AUTOSZERELO)
{
SendClientMessage(playerid, PIROS, \"Nem vagy autószerelõ!\");
RemovePlayerFromVehicle(playerid);
}
}
else if(GetPlayerVehicleID(playerid) == kocsik[mento][0] || GetPlayerVehicleID(playerid) == kocsik[mento][1] || GetPlayerVehicleID(playerid) == kocsik[mento][2])
{
if(munka[playerid] != MENTO)
{
SendClientMessage(playerid, PIROS, \"Nem vagy mentõs!\");
RemovePlayerFromVehicle(playerid);
}
}
else if(GetPlayerVehicleID(playerid) == kocsik[uttisztito][0] || GetPlayerVehicleID(playerid) == kocsik[uttisztito][1] || GetPlayerVehicleID(playerid) == kocsik[uttisztito][2])
{
if(munka[playerid] != UTTISZTITO)
{
SendClientMessage(playerid, PIROS, \"Nem vagy úttisztító!\");
RemovePlayerFromVehicle(playerid);
}
}
else if(GetPlayerVehicleID(playerid) == kocsik[pizzafutar][0] || GetPlayerVehicleID(playerid) == kocsik[pizzafutar][1])
{
if(munka[playerid] != PIZZAFUTAR)
{
SendClientMessage(playerid, PIROS, \"Nem vagy pizzafutár!\");
RemovePlayerFromVehicle(playerid);
}
}
else if(GetPlayerVehicleID(playerid) == kocsik[rendor][0] || GetPlayerVehicleID(playerid) == kocsik[rendor][1] || GetPlayerVehicleID(playerid) == kocsik[rendor][2] || GetPlayerVehicleID(playerid) == kocsik[rendor][3])
{
if(munka[playerid] != RENDOR)
{
SendClientMessage(playerid, PIROS, \"Nem vagy rendõr!\");
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(pizzacp[playerid] == true)
{
new str[128];
new bevetel = randomex(10000, 20000);
DisablePlayerCheckpoint(playerid);
format(str, 128, \"Sikeresen kiszállítottad a pizzát! Bevétel: %d$\", bevetel);
SendClientMessage(playerid, KEK, str);
GivePlayerMoney(playerid, bevetel);
pizzacp[playerid] = false;
return 0;
}
if(utasszallitas[playerid] == 1)
{
new rnd = random(sizeof(utasletetel));
SendClientMessage(playerid, ZOLD, \"Felvetted az utast, vidd a kijelölt helyre!\");
SetPlayerCheckpoint(playerid, utasletetel[rnd][0], utasletetel[rnd][1], utasletetel[rnd][2], 3);
utasszallitas[playerid] = 2;
return 0;
}
if(utasszallitas[playerid] == 2)
{
new str[128];
new bevetel = randomex(10000, 20000);
format(str, 128, \"Elvitted az utast a célponthoz. Bevétel: %d$\", bevetel);
GivePlayerMoney(playerid, bevetel);
SendClientMessage(playerid, KEK, str);
utasszallitas[playerid] = 0;
DisablePlayerCheckpoint(playerid);
PlayerPlaySound(playerid, 1137, 0, 0, 0);
return 0;
}
DisablePlayerCheckpoint(playerid);
PlayerPlaySound(playerid, 1137, 0, 0, 0);
return 1;
}
public OnPlayerUpdate(playerid)
{
if(bortonben[playerid] == true)
{
new box[50];
format(box, 50, \"Hátralévõ idõ: %d mp\", (bortonido[playerid]-leteltido[playerid])/1000);
TextDrawSetString(bortontd[playerid], box);
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1234)
{
new pName[24];
new str[128];
GetPlayerName(playerid, pName, 24);
if(listitem == 0)
{
format(str, 128, \"%s mostantól Rendõrként dolgozik!\", pName);
SendClientMessageToAll(SARGA, str);
SendClientMessage(playerid, -1, \"Válaszott munka: Rendõr\");
SetPlayerPos(playerid, 2289.1575,2427.6248,10.8203);
SetPlayerSkin(playerid, 283);
munka[playerid] = RENDOR;
}
if(listitem == 1)
{
format(str, 128, \"%s mostantól Mentõsként dolgozik!\", pName);
SendClientMessageToAll(SARGA, str);
SendClientMessage(playerid, -1, \"Válaszott munka: Mentõs\");
SetPlayerPos(playerid, 1604.5712,1824.0358,10.8203);
SetPlayerSkin(playerid, 276);
munka[playerid] = MENTO;
}
if(listitem == 2)
{
format(str, 128, \"%s mostantól Úttisztítóként dolgozik!\", pName);
SendClientMessageToAll(SARGA, str);
SendClientMessage(playerid, -1, \"Válaszott munka: Úttisztító\");
SetPlayerPos(playerid, 1656.1990,994.3511,10.8203);
SetPlayerSkin(playerid, 144);
munka[playerid] = UTTISZTITO;
}
if(listitem == 3)
{
format(str, 128, \"%s mostantól Pizzafutárként dolgozik!\", pName);
SendClientMessageToAll(SARGA, str);
SendClientMessage(playerid, -1, \"Válaszott munka: Pizzafutár\");
SetPlayerPos(playerid, 2083.1091,2220.4846,10.8203);
SetPlayerSkin(playerid, 155);
munka[playerid] = PIZZAFUTAR;
}
if(listitem == 4)
{
format(str, 128, \"%s mostantól Autószerelõként dolgozik!\", pName);
SendClientMessageToAll(SARGA, str);
SendClientMessage(playerid, -1, \"Válaszott munka: Autószerelõ\");
SetPlayerPos(playerid, 2393.4819,988.5132,10.8203);
SetPlayerSkin(playerid, 50);
munka[playerid] = AUTOSZERELO;
}
if(listitem == 5)
{
format(str, 128, \"%s mostantól Taxisként dolgozik!\", pName);
SendClientMessageToAll(SARGA, str);
SendClientMessage(playerid, -1, \"Válaszott munka: Taxis\");
SetPlayerPos(playerid, 1530.8282,2208.0488,11.2393);
SetPlayerSkin(playerid, 255);
munka[playerid] = TAXI;
}
}
return 1;
}
stock randomex(min,max) return random(1+max-min)+min;