Jump to content

[INC] Rotate Object ( rot_objects )


Roox

Recommended Posts

Rotate Object

INC


Statistika:

Doba promýšlení - 3 hodiny

Doba scriptování - 90 minut

Doba testování - 30 minut


Instalace:

Stáhněte si soubor rot_objects ( INC )

Vložte ho do - pawno/include

Nahoru do módu/FS

#include < rot_objects >

Někam do módu/FS

public OnObjectRotated(objectid)
{
    // Sem si můžete přidávat funkce např
    /*
    if(objectid == Brana)
    {
         SendClientMessageToAll(0xFF0000AA, "WARNING: Brána se pohnula !");
    }
    */
    return 1;
}


Funkce:

Rotující object

RotateObject(objectid, RotX, RotY, RotZ, Rychlost);

objectid - ID rotujícího objectu

RotX - Rotace X

RotY - Rotace Y

RotZ - Rotace Z

Rychlost - Rychlost rotace

 

Rotující object pro hráče

RotatePlayerObject(playerid, objectid, RotX, RotY, RotZ, Rychlost);

playerid - ID hráče, pro kterého bude object Rotovat

objectid - ID rotujícího objectu

RotX - Rotace X

RotY - Rotace Y

RotZ - Rotace Z

Rychlost - Rychlost rotace


WARNING:

Čím větší rychlost, tím více zatěžujete server !

Doporučuji ryhlost 3

 

Když už object rotuje a dáte mu další rotaci,

nic to neudělá


Rady:

Doporučuji na otvírání a zavírání závor

 

Object se vždy otáčí přes bližší stranu.


Download:

dMpv.jpg

Link to comment
Share on other sites

J díky.. Něco sem tam aktualizoval ( Object se otáčí na bližší stranu ).. A mělo by to všechno bejt v pohodě mě na testovaní všechno fungovalo. Tak se nemusíte bát nějakejch chyb ;)

Link to comment
Share on other sites

  • 9 months later...

Lidi ma takový problém udělal jsem si to takle:

 

public OnObjectRotated(objectid)
{
  	if (strcmp("/rotace", cmdtext, true, 10) == 0)
{
	RotateObject(brana, 2035.110,1345.497,9.897, 2);
return 1;
}
}

 

Ae píše my to tyto errory a warningy:

C:\Users\Honza\Desktop\zkouska-rotace.pwn(55) : error 017: undefined symbol "cmdtext"

C:\Users\Honza\Desktop\zkouska-rotace.pwn(60) : warning 209: function "OnObjectRotated" should return a value

 

 

Řádky:

55:

 

if (strcmp("/rotace", cmdtext, true, 10) == 0)

 

 

60:

 

}

 

 

PS: Zkoušel jsem vše furt my to píše toto :d

Link to comment
Share on other sites

Lidi ma takový problém udělal jsem si to takle:

 

public OnObjectRotated(objectid)
{
  	if (strcmp("/rotace", cmdtext, true, 10) == 0)
{
	RotateObject(brana, 2035.110,1345.497,9.897, 2);
return 1;
}
}

 

Ae píše my to tyto errory a warningy:

C:\Users\Honza\Desktop\zkouska-rotace.pwn(55) : error 017: undefined symbol "cmdtext"

C:\Users\Honza\Desktop\zkouska-rotace.pwn(60) : warning 209: function "OnObjectRotated" should return a value

 

 

Řádky:

55:

 

if (strcmp("/rotace", cmdtext, true, 10) == 0)

 

 

60:

 

}

 

 

PS: Zkoušel jsem vše furt my to píše toto :d

 

z dvou radku ti neporadim akorat ze ti nekde chyby return a pak uz nwm protoze dva radky je malo

Link to comment
Share on other sites

Lidi ma takový problém udělal jsem si to takle:

 

public OnObjectRotated(objectid)
{
  	if (strcmp("/rotace", cmdtext, true, 10) == 0)
{
	RotateObject(brana, 2035.110,1345.497,9.897, 2);
return 1;
}
}

 

Ae píše my to tyto errory a warningy:

C:\Users\Honza\Desktop\zkouska-rotace.pwn(55) : error 017: undefined symbol "cmdtext"

C:\Users\Honza\Desktop\zkouska-rotace.pwn(60) : warning 209: function "OnObjectRotated" should return a value

 

 

 

 

Řádky:

55:

 

if (strcmp("/rotace", cmdtext, true, 10) == 0)

 

 

60:

 

}

 

 

PS: Zkoušel jsem vše furt my to píše toto :d

 

z dvou radku ti neporadim akorat ze ti nekde chyby return a pak uz nwm protoze dva radky je malo

 

return mam všude :d

Link to comment
Share on other sites

 

#include 
#include < rot_objects >

new brana;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
brana = CreateObject(967,2035.084,1345.453,9.820,0.0,0.0,90.000);
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

#else

main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}

#endif

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
return 1;
}

public OnObjectRotated(objectid)
{
  	if (strcmp("/rotace", cmdtext, true, 10) == 0)
{
	RotateObject(brana, 2035.110,1345.497,9.897, 2);
return 1;
}
}

 

 

PLS HELP

Link to comment
Share on other sites

public OnObjectRotated(objectid)
{
  if (strcmp("/rotace", cmdtext, true, 10) == 0)
  {
  RotateObject(brana, 2035.110,1345.497,9.897, 2);
  }
  return 1;
  }

 

a to druhy to nwm co si tam zmrsil :d

ale znamena to ze ten public nema funkci cmdtext a kdyz ji tam dam tak sami warningy :(

Link to comment
Share on other sites

Error:

 

C:\Users\Honza\Desktop\zkouska-rotace.pwn(55) : error 017: undefined symbol "cmdtext"

 

 

Řádek:

 

if (strcmp("/rotace", cmdtext, true, 10) == 0)

 

 

Celé FS:

 

#include 
#include < rot_objects >

new brana;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
brana = CreateObject(967,2035.084,1345.453,9.820,0.0,0.0,90.000);
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

#else

main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}

#endif

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
return 1;
}

public OnObjectRotated(objectid)
{
  if (strcmp("/rotace", cmdtext, true, 10) == 0)
  {
  RotateObject(brana, 2035.110,1345.497,9.897, 2);
  }
  return 1;
}

 

 

PLS HELP

Link to comment
Share on other sites

v publicu musis mat "cmdtext" definovane ako je v OnPlayerCommandText(playerid, cmdtext[])

 

//EDIT: alebo ten prikaz hod do toho publicu OnPlayerCommandText(playerid, cmdtext[]) :d

Link to comment
Share on other sites

v publicu musis mat "cmdtext" definovane ako je v OnPlayerCommandText(playerid, cmdtext[])

 

//EDIT: alebo ten prikaz hod do toho publicu OnPlayerCommandText(playerid, cmdtext[]) :d

 

asi těžko ho dam on OnPLayerCommandText když to musím mít v tom public Rotated jinak by to nic neudělalo :d

 

//EDIT: a stejně furt ten samej error

Link to comment
Share on other sites

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...