[POMOC] /avozilo komanda

Započeo samper0, Februar 03, 2015, 16:16:15 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Detaljan opis problema: Zelio bih da napravim komande /avozilo i /anrg komande kojim bi se stvorio A/S vozilo.
Skripta koju koristim: Malboro YuPlay by Pinki
Neke slike/video/kod za lakse dobivanje pomoci (npr.slika server.cfg, server log ili slično): //

To je jednostavno.Pogledaj iz tog moda cmd:veh .Pretpostavljam da hoćeÅ¡ da stvori  odredjeno vozilo tada,samo stavi ID vozila umjesto modelid ((  http://wiki.sa-mp.com/wiki/CreateVehicle ))

A ako hoćeÅ¡ malo bolje to,pa da ako je odreÄ'eni igrač mu se auto uniÅ¡ti kad ode off ili kada ponovo ukuca /avozilo onda jednostavno kreiraÅ¡ neku varijablu,i kada ukuca /avozilo da mu stavi varijablu na 1.
Primjer

cmd:avozilo(playerid, params[])
{
(tu ako hoćeš provjere je li admin ili šta već)
if(avozilo[playerid] == 0)
{
//kreiras
avozilo[playerid] = 1;
}
else if(avozilo[playerid] == 1)
{
//unisti
avozilo[playerid] = 0;
}
return 1;
}


Ako ne bude jasno javi..

Ovako je kod mene, mozda ti nesto pomogne :)
YCMD:avozilo(playerid, params[],help)
{
    #pragma unused help
    if(UlogovanProvera[playerid] == 0) return SCM(playerid,-1,""CRVENA"Moras se ulogovati da bi koristio ovu komandu!");
new Float:Pos[4];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
if(PlayerInfo[playerid][pAdmin] >= 1)
{
    if(AdminDuty[playerid] == 0) return SCM(playerid,-1,""SIVA"Morate biti na Admin duznosti!");
if(AdminVozilo[playerid] == -1)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, 0, alarm, doors, bonnet, boot, objective);
vozilo1 = CreateVehicle(579,Pos[0],Pos[1],Pos[2],Pos[3],random(1),random(1),500);
PutPlayerInVehicle(playerid,vozilo1,0);
AdminVozilo[playerid] = vozilo1;
SCM(playerid,-1,""CRVENA"Stvorili ste Admin vozilo.");
}
else if(AdminVozilo[playerid] != -1)
{
DestroyVehicle(AdminVozilo[playerid]);
AdminVozilo[playerid] = -1;
SCM(playerid,-1,""CRVENA"Unistili ste Admin vozilo.");
}
}
else return SCM(playerid,-1,""SIVA"Samo Admini.");
return 1;
}
YCMD:anrg(playerid, params[],help)
{
    #pragma unused help
    if(UlogovanProvera[playerid] == 0) return SCM(playerid,-1,""CRVENA"Moras se ulogovati da bi koristio ovu komandu!");
new Float:Pos[4];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
if(PlayerInfo[playerid][pAdmin] >= 1)
{
    if(AdminDuty[playerid] == 0) return SCM(playerid,-1,""SIVA"Morate biti na Admin duznosti!");
if(AdminNRG[playerid] == -1)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, 0, alarm, doors, bonnet, boot, objective);
vozilo1 = CreateVehicle(522,Pos[0],Pos[1],Pos[2],Pos[3],random(1),random(1),500);
PutPlayerInVehicle(playerid,vozilo1,0);
AdminNRG[playerid] = vozilo1;
SCM(playerid,-1,""CRVENA"Stvorili ste Admin vozilo.");
}
else if(AdminNRG[playerid] != -1)
{
DestroyVehicle(AdminNRG[playerid]);
AdminNRG[playerid] = -1;
SCM(playerid,-1,""CRVENA"Unistili ste Admin vozilo.");
}
}
else return SCM(playerid,-1,""SIVA"Samo Admini.");
return 1;
}
Poslednja Izmena: Februar 03, 2015, 20:59:48 POSLE PODNE od °Dєσdℓιηє™ ツ

Mapper & Skripter
____________________________________

Moj Facebook
____________________________________
Pretplati se Nikola Deadline

Otvorim pawno zatim mod i ovo pastujem tu i nakon toga udje IG i kucam /anrg i /avozilo i izadje ovo

http://i.imgur.com/Mgu3J11.png


Izvinite ako vam smetam , pocetnik sam , ubacio sam na kraj moda


Isto , imam komandu /veh ali modelid od 400-500 id i ne moze druga vozila

CitatCMD:veh(playerid, params[])
{
   if( isnull( params ) ) return SendClientMessage(playerid, NARANDZASTA, "Koristite: /veh [ID Modela]");
   if(!IsPlayerConnected(playerid)) return 0;
   if(PlayerInfo[playerid][pAdmin] >= 6)
   {
      if(vehspawned[playerid] == 1) return SCM(playerid, GRAD2, "Vec ste spawnovali 1 vozilo koristite /dveh sa ga unistite!");
      new Float:Poz[4];
      if( isnull( params ) ) return SendClientMessage(playerid, NARANDZASTA, "Koristite: /veh [ID Modela]");
      GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
      GetPlayerFacingAngle(playerid, Poz[3]);
      vehid1[playerid] = CreateVehicle_H(strval(params), Poz[0]+4, Poz[1], Poz[2], Poz[3], 1, 1, -1);
      VehiclePos[vehid1[playerid]][0] = Poz[0];
        VehiclePos[vehid1[playerid]][1] = Poz[1];
        VehiclePos[vehid1[playerid]][2] = Poz[2];
      vehspawned[playerid] = 1;
      new [cenzura] = vehid1[playerid];
      format(CmdString, sizeof CmdString, "Vozilo stvoreno! [Vozilo ID: %d | Model vozila: %s]", vehid1[playerid], ImenaVozila[strval(params) - 400]);
      SCM(playerid, ZELENA2, CmdString);
      SCM(playerid, NARANDZASTA, "{FFFFFF}Pre nego sto stvoris drugo vozilo, moras unistiti trenutno. (/dveh)");
       new engine, lights, alarm, doors, bonnet, boot, objective;
      GetVehicleParamsEx([cenzura], engine, lights, alarm, doors, bonnet, boot, objective);
      SetVehicleParamsEx([cenzura], 1, 1, alarm, doors, bonnet, boot, objective);
      engineOn[[cenzura]] = true;
      PutPlayerInVehicle(playerid, [cenzura], 0);
      SetVehicleHealth_H([cenzura], 999.99);

      //new vehidgorivo = GetPlayerVehicleID(playerid);
      //Gorivo[vehidgorivo] = 999.00;
   }
   else return SCM(playerid, GRAD2, "{BFC0C2}You are not authorized !");
   return 1;
}



Citat////////////////////veh SYS/////////////////////////
new vehspawned[MAX_PLAYERS];
new vehid1[MAX_PLAYERS];
new ImenaVozila[][] = {
   "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto",
   "Taxi","Washington","Bobcat","Mr Whoopee","BF Injection","Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion",
   "Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van",
   "Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider","Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR 350","Walton","Regina",
   "Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood","Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson",
   "Mesa","RC Goblin","Hotring Racer","Hotring Racer","Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain","Nebula","Majestic","Buccaneer","Shamal",
   "Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck","Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex",
   "Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster","Monster","Uranus","Jester",
   "Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer","Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley",
   "Stafford","BF-400","Newsvan","Tug","Trailer","Emperor","Wayfarer","Euros","Hotdog","Club","Trailer","Trailer","Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)","Police Car (LVPD)","Police Ranger",
   "Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer","Luggage Trailer","Stair Trailer","Boxville","Farm Plow","Utility Trailer"
};
Poslednja Izmena: Februar 04, 2015, 19:49:40 POSLE PODNE od Duke_Robik



Molimo te da procitas pravila foruma te da onda otvoris temu po pravilima.

Razlog zakljucavanja:
Prošlo duže od 2 dana (48h) nema odgovora autora problem se smatra riješenim!

Pravila:

Glavna pravila Balkan SA:MP foruma .

Pomoc u vezi SA:MP servera .

Nešto vam nije jasno u vezi SA:MP servera? Posjetite PDF Pomoć u vezi SA:MP servera!