Kosac Trave

Započeo Bosske, Novembar 29, 2017, 14:02:36 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Pozdrav evo jedan tutorijal kako da se napravi kosac trave nije komplikovano pa da krenemo
prvo sto trebate imati je include asamp sscanf i zcmd
[pawn]
#include < a_samp >
#include <sscanf2>
#include <zcmd>
[/pawn]

onda trebate uraditi jeste definsati start i kosactrave pa da pocnemo
[pawn] new VoziloKosaca[11]; // definise 10 vozila namjenjenih za kosaca trave
new Start[ MAX_PLAYERS ] ; // definise jednu varijablu koju ce te koristiti za posao
new kositravu[MAX_PLAYERS]; // definise pocetak i kraj kosaca trave[/pawn]
zatim idemo do public on game mode init
zatim stavljamo

[pawn]
public OnGameModeInit()
{
//============================================[VOZILA]============================================//

//===========================================[KOSAC TRAVE]==============================//
VoziloKosaca[1]=AddStaticVehicle(572,1952.9606,-1248.7236,19.2738,356.2620,101,1);
VoziloKosaca[2]=AddStaticVehicle(572,1950.2513,-1248.6025,19.1852,356.0848,116,1);
VoziloKosaca[3]=AddStaticVehicle(572,1947.7122,-1248.5604,19.0928,358.6038,101,1);
VoziloKosaca[4]=AddStaticVehicle(572,1945.2097,-1248.5056,18.9082,357.3105,25,1);
VoziloKosaca[5]=AddStaticVehicle(572,1943.2260,-1248.6458,18.7149,356.7913,116,1);
VoziloKosaca[6]=AddStaticVehicle(572,1955.1508,-1248.7366,19.3456,357.5720,116,1);
VoziloKosaca[7]=AddStaticVehicle(572,1957.5271,-1248.5740,19.4235,1.5130,116,1);

SetGameModeText(Teskt); // to vec imas ne upisuj ga
AddPlayerClass(0,1933.0145,-1247.8140,18.1099,351.8568,0,0,0,0,0,0); // spawna te kod kosaca trave
return 1;
}
[/pawn]

onda pravimo komandu za pocetak posla
ispod zadnjeg Publika stavljate

[pawn] CMD:kositravu(playerid, params[])
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 572) return SendClientMessage(playerid, -1, ""CRVENA"[Greska]"BELA"Nisi u kosilici!"); // provjerava da li je igrac u kosilici
if(GetPlayerState(playerid)!=PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, ""CRVENA"[Greska]"BELA"Niste na mestu vozaca!"); // prvojerava da li je igrac na mestu vozaca
SendClientMessage(playerid, -1, ""CRVENA"[Gazda]"BELA"Poceli ste posao pratite crvene markere!"); // salje poruku igracu da krece sa poslom
SetPlayerCheckpoint(playerid, 1916.2914,-1227.7218,17.9356,3.0); // postavlja prvi checkpoint
kositravu[playerid] = 1; // definise pocetak posla
return 1;
}[/pawn]

onda trazite OnPlayerEnterCheckpoint i kucate
[pawn] DisablePlayerCheckpoint(playerid); // sluzi da u svakom ulazu u checkpoint izbrise marker


if(Start[playerid] == 0)
{
Start[playerid]++; // definisali smo to na vrhu a ++ znaci da se dodaje jos jedan checkpoint
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!"); // salje poruku igracu da je usao u cp
SetPlayerCheckpoint(playerid, 1910.9065,-1183.4401,22.4342,3.0); // daje novi checkpoint
}
else if(Start[playerid] == 1)
{
Start[playerid]++; // imate u prvom
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!"); // isto u prvom
SetPlayerCheckpoint(playerid, 1931.7922,-1163.5945,21.7143,3.0); // isto u prvom
}
else if(Start[playerid] == 2)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 1987.4614,-1160.8689,20.9246,3.0);
}
else if(Start[playerid] == 3)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 2002.5663,-1151.8746,22.6814,3.0);
}
else if(Start[playerid] == 4)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 2033.7629,-1153.7010,23.1089,3.0);
}
else if(Start[playerid] == 5)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 2048.2009,-1175.2698,23.3794,3.0);
}
else if(Start[playerid] == 6)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 2051.2400,-1192.6033,23.6568,3.0);
}
else if(Start[playerid] == 7)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 2036.9088,-1211.2786,22.7420,3.0);
}
else if(Start[playerid] == 8)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 2024.1387,-1231.1516,21.9697,3.0);
}
else if(Start[playerid] == 9)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 2010.5756,-1243.9318,22.9093,3.0);
}
else if(Start[playerid] == 10)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 1967.6573,-1237.8304,20.0643,3.0);
}
else if(Start[playerid] == 11)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 1934.7108,-1241.4706,18.1986,3.0);
}
else if(Start[playerid] == 12)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 1899.2908,-1240.4778,15.3721,3.0);
}
else if(Start[playerid] == 13)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 1879.1080,-1216.7605,17.5216,3.0);
}
else if(Start[playerid] == 14)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 1882.9692,-1198.0802,20.8116,3.0);
}
else if(Start[playerid] == 15)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 1888.9762,-1178.1691,23.8187,3.0);
}
else if(Start[playerid] == 16)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 1921.9597,-1161.4310,22.5862,3.0);
}
else if(Start[playerid] == 17)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 1992.9346,-1160.7639,20.9698,3.0);
}
else if(Start[playerid] == 18)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 2030.7892,-1207.1803,21.9423,3.0);
}
else if(Start[playerid] == 19)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 2016.4780,-1223.7859,21.5503,3.0);
}
else if(Start[playerid] == 20)
{
Start[playerid]++;
SendClientMessage(playerid,-1,""CRVENA"[Gazda]"BELA"Svaka cast nastavi dalje!");
SetPlayerCheckpoint(playerid, 1995.2039,-1228.4075,20.5757,3.0);
}
else if(Start[playerid] == 21)
{
GivePlayerMoney(playerid , 700); // daje igracu odredjeni broj para ja sam stavio 700 vi mozete i vise
SendClientMessage(playerid, -1, ""CRVENA"[Gazda]"BELA"Pokosili ste travnjak i dobili platu u iznosu od 700 dolara!"); // salje igracu da je zavrsio sa kosidbom
Start[playerid] = 0; // sluzi da ugasi checkpoint
kositravu[playerid] = 0; // takodje
} [/pawn]

eto to je za kosaca trave ugodan dan zelim!!!  ;D ;D

Ne vjerujem ja da si ti ovo uradio, 1 lik je imao probleme s tim i ja sam mu pomogao, ako si ti taj lik onda ok :)

Citat: Sploxs poslato Novembar 29, 2017, 14:05:32 POSLE PODNE
Ne vjerujem ja da si ti ovo uradio, 1 lik je imao probleme s tim i ja sam mu pomogao, ako si ti taj lik onda ok :)

jesam uradio ne brini se :D

Kopiro si post,samo se nemg sjetit lika sto je ovo objavio