Jump to content
  • 0

pomoc Move object na zatrúbenie


Lemon

Dotaz

22 odpovědí na tuto otázku

Recommended Posts

  • 0
A nenapíšeš mi presnejšie .. lebo ja hľadám http://wiki.sa-mp.com/wiki/Category:Scripting_Functions a nič ...

 

tak si tam napis OnPlayerKeyStateChange vlevo uprostred, pokud ses tak shnily tak tu mas primy odkaz, pak si najdi MoveObject, pokud si shnily jak se zda tak tu mas dalsi primy, kod ti tu nikdo psat nebude, nauc se to

Link to comment
Share on other sites

  • 0
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
if(IsPlayerInAnyVehicle(playerid)
{
if(newkeys & KEY_CROUCH)
{
//zde podmínka na dveře zda jsou zavřeny a pak moveobject
}
}
return 1;
}

chyba ti podmienka aby to slo len v urcitej vzdialenosti...a nie globalne na celej map + podmienka sa da zapisat aj if(IsPlayerInAnyVehicle(playerid) && newkeys & KEY_CROUCH)

 

teraz si uz len niesom isty..ci tam nechyba zatvorka...

Link to comment
Share on other sites

  • 0

Mám to takto , ale nedal som tu celý FilterScriptInit dôvod nemusím udávať..

#include 
new brana;
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
CreateObject(987, -656.70001220703, 963.09997558594, 11.10000038147, 0,0,88);	
brana= CreateObject(968, -717.5, 950.40002441406, 12.10000038147, 0, 270, 90);
return 1;
}

#endif
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(newkeys & KEY_CROUCH)
{
MoveObject(brana,-717.5, 950.5, 12.10000038147,3);
}
}
return 1;
}

Link to comment
Share on other sites

  • 0

to máš jen otevření :d udělej si

new bool:op;

do onfilterscriptinit dáš

op = true;

a do podmínky if(newkeys ........ dáš

if(op == true)
{
moveobject
op = false;
} else if(op == false)
{
moveobject
op = true;
}

zapomněl jsem na IsPlayerRnageOfPoint zda je hráč poblíš ak chceš tak tam taky dej tu podmínku

if(IsPlayerRangeOfPoint(playerid,range,x,y,z))
{
//zde to předešlé
}

Link to comment
Share on other sites

  • 0

Oh my good ja ti vôbec nechápem :(

if(op == true)
{
moveobject
op = false;
} else if(op == false)
{
moveobject
op = true;
}

Ako to zistí , že sa to má otvoriť a tak ? :o

Link to comment
Share on other sites

  • 0
#include 
new brana;
new bool:op;
public OnFilterScriptInit()
{
CreateObject(987, -656.70001220703, 963.09997558594, 11.10000038147, 0,0,88);   
brana= CreateObject(968, -717.5, 950.40002441406, 12.10000038147, 0, 270, 90);
op = true;
  return 1;
}


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(newkeys & KEY_CROUCH)
{
if(IsPlayerRangeOfPoint(playerid,range,x,y,z))
{
if(op == true)
{
moveobject(...)//otevření
op = false;
} else if(op == false)
{
moveobject(...);//zavření
op = true;
}
}
}
}
return 1;
}

Link to comment
Share on other sites

  • 0
kdyby si nebyl trochu líný hledat,tak tu je na to návod :hallo:

 

 

 

otevirani-zavirani-brany-zatroubenim-t6477.html

 

viewtopic.php?f=8&t=138&hilit=br%C3%A1na

 

Pavelda tu ti prisahám , že som to hľadal a nenašlo mi to :(

Link to comment
Share on other sites

  • 0
#include 
new brana;
new bool:op;
public OnFilterScriptInit()
{
CreateObject(987, -656.70001220703, 963.09997558594, 11.10000038147, 0,0,88);   
brana= CreateObject(968, -717.5, 950.40002441406, 12.10000038147, 0, 270, 90);
op = true;
  return 1;
}


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(newkeys & KEY_CROUCH)
{
if(IsPlayerRangeOfPoint(playerid,range,x,y,z))
{
if(op == true)
{
moveobject(...)//otevření
op = false;
} else if(op == false)
{
moveobject(...);//zavření
op = true;
}
}
}
}
return 1;
}

Link to comment
Share on other sites

  • 0
kdyby si nebyl trochu líný hledat,tak tu je na to návod :hallo:

 

 

 

otevirani-zavirani-brany-zatroubenim-t6477.html

 

viewtopic.php?f=8&t=138&hilit=br%C3%A1na

 

Pavelda tu ti prisahám , že som to hľadal a nenašlo mi to :(

 

neva,ale příšte hledej lépe,nejdřív hledej v sekcích navody a jak udělat,nebo scripty,když nenajdeš ,search a pak až help :hallo:

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