Jump to content
  • 0

O problema Script.


Guest alexura12

Question

Guest alexura12

Salut,am facut si eu un gate la baza Triads,si am o problema...Am pus comanda /gate sa se deschida numai ca as vrea sa madific draw distace adica...eu pot deschide poarta de oriunde..si as vrea sa stiu cum sa fac sa se deschida cand sunt in fata ei..

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Guest alexura12

Aici sunt coordonatele de unde sa se deschida -  AddPlayerClass(271,-2251.6177,643.5991,49.2969,264.6840,0,0,0,0,0,0); //

Si Fs-ul cu comanda:

#define COLOR_YELLOW 0xFFFF00AA

#define COLOR_BLUE 0x2641FEAA

#define FILTERSCRIPT

#include <a_samp>

#define FILTERSCRIPT

forward GateClose();

new gate;

public OnFilterScriptInit()

{

gate = CreateObject(971, -2242.361328, 643.135803, 51.993179, 0.0000, 0.0000, 269.9999);

print("\n--------------------------------------");

print("            Gate [FS]                  ");

print("--------------------------------------\n");

return 1;

}

public OnFilterScriptExit()

{

return 1;

}

public OnPlayerCommandText(playerid, cmdtext[])

{

   if (strcmp(cmdtext, "/gate", true)==0)

   {

       MoveObject(gate,-2242.358643, 644.206421, 59.069702, 5.5);

       SetTimer("GateClose", 2000, 0);

       SendClientMessage(playerid, COLOR_BLUE,"In 5 secunde poarta se va inchide");

       GivePlayerMoney(playerid,0);

       return 1;

   }

   return 0;

}

public GateClose()

{

   MoveObject (gate, -2242.361328, 643.135803, 51.993179, 2.5);

   return 1;

}

Link to comment
Share on other sites

Uite ti-am facuto si pentru triads doar ca trebuie sa schimbi id-ul factiuni sper ca stii macar asta

#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_BLUE 0x2641FEAA
#define FILTERSCRIPT
#include <a_samp>
#define FILTERSCRIPT
forward GateClose();
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
new gate;
enum pInfo
{
   pMember,
   pLeader,
}
new PlayerInfo[MAX_PLAYERS][pInfo];


public OnFilterScriptInit()
{
	gate = CreateObject(971, -2242.361328, 643.135803, 51.993179, 0.0000, 0.0000, 269.9999);


	print("\n--------------------------------------");
	print("            Gate [FS]                  ");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/gate", true)==0)
    {
      if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) //Schimbi si tu id-ul factiuni
		{
           if(PlayerToPoint(10.0, playerid, -2251.6177,643.5991,49.2969))
           {
           MoveObject(gate,-2242.358643, 644.206421, 59.069702, 5.5);
           SetTimer("GateClose", 2000, 0);
           SendClientMessage(playerid, COLOR_BLUE,"In 5 secunde poarta se va inchide");
           GivePlayerMoney(playerid,0);
           return 1;
           }
           else
           {
              SendClientMessage(playerid, COLOR_YELLOW,"You are not member of Triads");
           }
        }
    }
    return 0;
}

public GateClose()
{
    MoveObject (gate, -2242.361328, 643.135803, 51.993179, 2.5);
    return 1;
}

public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    if(IsPlayerConnected(playerid))
	{
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		GetPlayerPos(playerid, oldposx, oldposy, oldposz);
		tempposx = (oldposx -x);
		tempposy = (oldposy -y);
		tempposz = (oldposz -z);
		//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
		if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
		{
			return 1;
		}
	}
	return 0;
}

Nu uita +1 :P

Samp.OnlyPro.ro - RolePlay - Join Us !

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.