Jump to content

Vytváříme auta/objekty


Recommended Posts

Ano,ano! Mach37 je tu zase se svým /trapným/ TuTem ... :crazy:

 

//Tento tut je spíše pro začátečníky// :problem:

Takže připravil jsem si pro Vas takovej malej tut kterej vytvoří auto - s objekty je to to same akorat prepisete par vecicek...Deme na to:

 

OnPlayerCommandText

dcmd(car,3, cmdtext); //nezabudnite! :-D

 

dcmd_car(playerid,params[]) {
new carid = strval(params[0]);
/* ---> ZDE SI DOPLŇTE VAŠÍ PROMĚNOU / ISPLAYERADMIN <--- */
if(!params[0])return SendClientMessage(playerid, COLOR_BLUE, "Špatně! Správně je: /car [iD vozidla]");
if(carid < 400 || carid > 611) return SendClientMessage(playerid, COLOR_BLUE, "Spatne ID Auta -- Auta jsou od 400 do 611");
if(IsPlayerConnected(playerid)){ // Je hrač online? jestli ano tak zacneme
new Float:X,Float:Y,Float:Z; // new pro X,Y,Z
GetPlayerPos(playerid,X,Y,Z);
CreateVehicle(carid, X, Y, Z, 1, 1, 2, 90); /* takže tady je samotna podstata: car - id auta, X,Y,Z - souradnice,1 - Facing angle :-D nevim odkdy ma auto face ale tj jedno,1barva čislo 1,2 - barva čislo 2 (šlo by to udělat i s vyberem barvy např. /car 424 1 1 ale v tomhle tutu se zabyvam spis vytvořenim),
90 - Respawn cas, cas když z toho auta vystoupi nekdo a za jak dlouho se respawne na puvodni pozici v sekundach...*/
SendClientMessage(playerid,COLOR_BLUE, "Vytvoril jsi auto!"); //informujeme ho že vytvořil auto ..třeba je namesicnej a ani nevi co dela tak radsi mu to reknem 
return true;
}
return true;
}

 

Testoval jsem to i s bugsym

 

Errory:

 

undefined symbol dcmd :

definice:

#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

undefined symbol COLOR_BLUE

#define COLOR_BLUE 0x4169FFAB

 

Určitě tam někdo (nějakej pawner :-)) najde chybu tak kdybyste ji objevili pisněte :geek:

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 4 weeks later...

prepacte za stary topci a za double posting ale potreboval by som /znic ako ze znici caru

a este ze max 2 a este ze farbu auta :d dik

a este

error 030: compound statement not closed at the end of file (started at line 1763)

Link to comment
Share on other sites

hore do modu:

 

new auticko;

 

do scriptu

 

if(auticko == 2)

{

DestroyVehicle(auticko);

}

 

auticko++;

 

auticko = CreateVehicle(carid, X, Y, Z, 1, 1, 2, 90);

 

 

no a farby sa mi nechce :lol:

Link to comment
Share on other sites

kde mam toto dat ?

 

if(auticko == 2)

{

DestroyVehicle(auticko);

}

 

auticko++;

 

auticko = CreateVehicle(carid, X, Y, Z, 1, 1, 2, 90);

 

ale mam tka dalej wnm mam new

dcmd_car(playerid,params[]) {
new carid = strval(params[0]);
if(!params[0])return SendClientMessage(playerid, COLOR_RED, "Napiste : /car [iD auta] (pomocky aut su v /auta)");
if(carid < 400 || carid > 611) return SendClientMessage(playerid, COLOR_BLUE, "Spatne ID Auta -- Auta jsou od 400 do 611");
if(IsPlayerConnected(playerid)){
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
CreateVehicle(carid, X, Y, Z, 1, 1, 2, 90);
SendClientMessage(playerid,COLOR_BLUE, "Vytvoril si si auto max.aut- 2!");
return true;
}
if(auticko == 2)
{
DestroyVehicle(auticko);
}

return true;
}

Link to comment
Share on other sites

boze

 

dcmd_car(playerid,params[]) {
new carid = strval(params[0]);
if(!params[0])return SendClientMessage(playerid, COLOR_RED, "Napiste : /car [iD auta] (pomocky aut su v /auta)");
if(carid < 400 || carid > 611) return SendClientMessage(playerid, COLOR_BLUE, "Spatne ID Auta -- Auta jsou od 400 do 611");
if(IsPlayerConnected(playerid)){
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
f(auticko == 2)
{
DestroyVehicle(auticko);
}

auticko++;

auticko = CreateVehicle(carid, X, Y, Z, 1, 1, 2, 90); 
SendClientMessage(playerid,COLOR_BLUE, "Vytvoril si si auto max.aut- 2!");
return true;
}

Link to comment
Share on other sites

jaj cky viem preco nekonecno. skus toto

 

dcmd_car(playerid,params[]) {
new carid = strval(params[0]);
if(!params[0])return SendClientMessage(playerid, COLOR_RED, "Napiste : /car [iD auta] (pomocky aut su v /auta)");
if(carid < 400 || carid > 611) return SendClientMessage(playerid, COLOR_BLUE, "Spatne ID Auta -- Auta jsou od 400 do 611");
if(IsPlayerConnected(playerid)){
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
f(auticko == 2)
{
DestroyVehicle(auticko);
auticko = 0;
}

auticko++;

auticko = CreateVehicle(carid, X, Y, Z, 1, 1, 2, 90); 
SendClientMessage(playerid,COLOR_BLUE, "Vytvoril si si auto max.aut- 2!");
return true;
}

Link to comment
Share on other sites

takto to mam v mojom pripravovanom AS, s tym rozdielom ze to je len pre jedneho hraca ale mne sa znici ked napisem znova /mheli :)

 

dcmd_mheli(playerid,params[])
{
#pragma unused params
if(ALVL[playerid] < 2)return SendClientMessage(playerid,COLOR_SYSTEM,"[  !  ] Nemáš dostatočný Admin Level.");
else
{
    if(helik[playerid] == 1)
    {
	    DestroyVehicle(heli);
	    helik[playerid] = 0;
    }
	new Float:X,Float:Y,Float:Z;
	GetPlayerPos(playerid,X,Y,Z);
	heli = CreateVehicle(487,X+5,Y,Z,1,2,1,2000);
	helik[playerid] = 1;
	PutPlayerInVehicle(playerid,heli,0);
	SendClientMessage(playerid,COLOR_SYSTEM,"[  !  ] Vozidlo bolo úspešne vytvorené.");
}
return true;
}

Link to comment
Share on other sites

dcmd_mheli(playerid,params[])
{
  {
      if(helik[playerid] == 1)
      {
         DestroyVehicle(heli);
         helik[playerid] = 0;
      }
     new Float:X,Float:Y,Float:Z;
     GetPlayerPos(playerid,X,Y,Z);
     heli = CreateVehicle(487,X+5,Y,Z,1,2,1,2000);
     helik[playerid] = 1;
     PutPlayerInVehicle(playerid,heli,0);
     SendClientMessage(playerid,COLOR_SYSTEM,"[  !  ] Vozidlo bolo úspešne vytvorené.");
  }
  return true;
}

 

a pise som yvmazal lvl lebo chcem aby kazdy si vytvoril

(1790) : error 017: undefined symbol "helik"

(1790) : warning 215: expression has no effect

(1790) : error 001: expected token: ";", but found "]"

(1790) : error 029: invalid expression, assumed zero

(1790) : fatal error 107: too many error messages on one line

Link to comment
Share on other sites

good tut very nice aj bugy super

 

 

Tak řekni jaký bugy...

 

Já tam dal jen že to vytvoří auto 400 až 611 bo kolik jich je a žadnej bug nevidim ano.. dava to nekončeno aut a ano nedava to barvy řek sem že je to jen pro začatek tak dělej jaky sou ty bugy?!

 

A jestli si to myslel jako Bugy jako auto tak to jo :mrgreen: ae i tak se ptam jaky bugy :crazy:

Link to comment
Share on other sites

OMG Lolku koukam že se vyznaš řikam, že je to jako v DEBUGu a že je to jen jako příklad params příkazu!! :spam: :wtf: to neni bug pokud tam nedam omezení víš co je moje věc...

Link to comment
Share on other sites

  • 7 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...