Jump to content
  • 0

pomoc brana help


Guest StReeY [Dinti]

Dotaz

4 odpovědí na tuto otázku

Recommended Posts

  • 0

Hore do modu:

forward brana();
new brana; 

 

Do OnGameModeInIt:

SetTimer("brana",1100,1);
brana = CreateObject(ID OBJEKTU,SURADNICE);

 

Dole do modu niekam:

IsPlayerInSphere(playerid,Float:x,Float:y,Float:z,radius)
{
  if(GetPlayerDistanceToPointEx(playerid,x,y,z) < radius){
  return 1;
}
  return 0;
}

GetPlayerDistanceToPointEx(playerid,Float:x,Float:y,Float:z)
{
  new Float:x1,Float:y1,Float:z1;
  new Float:tmpdis;
  GetPlayerPos(playerid,x1,y1,z1);
  tmpdis = floatsqroot(floatpower(floatabs(floatsub(x,x1)),2)+floatpower(floatabs(floatsub(y,y1)),2)+floatpower(floatabs(floatsub(z,z1)),2));
  return floatround(tmpdis);
}

 

public brana() {
for(new i=0;iif(IsPlayerConnected(i)) {
if(IsPlayerInSphere(i,SURADNICE,RADIUS)) {
MoveObject(brana,SURADNICE,RYCHLOST);//pozicia otvorenej brany
}else{
MoveObject(brana,SURADNICE,RYCHLOST);//pozicia zatvorenej brany
}
}
}
return 1;
}

 

 

DUFAM,ZE SOM NIC NEVYNECHAL!!

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