17.07.2012, 18:04
(
Последний раз редактировалось Liepaajnieks; 17.07.2012 в 18:26.
Причина: Some mistakes
)
Hello ppls, i am not Eng so i try to explain all problems what i have and i hope u understand it.
1.st How i can create Movable gates with cmd /go or /opengate for only Faction members? i tryed a lot of codes from this nicely forum, but it didnt work if i change TeamID's, so someone can please show me Code for movable gates for factions, and... i know only how to create movable gates for all players, just anyone can type cmd and gates are opened, but it is a Filterscript. Here is Filterscript code, but that gates can open anyone, just need to type cmd, please someone who are smarter than me on scripting things, change this code a bit, so only Yamaguchi can open thoose gates. I rly appreaciate it.
I also tryed to use this filterscript, that gates are located in Ganton, i just changed faction id, and tryed open gates , but it didnt work
Huh.. I tryed change that codes in all ways how i can think, But still didnt worked for Factions..all can open 
I use Raven's rp gamemode v4.2
Cya ppls, again soory for bad Eng.
1.st How i can create Movable gates with cmd /go or /opengate for only Faction members? i tryed a lot of codes from this nicely forum, but it didnt work if i change TeamID's, so someone can please show me Code for movable gates for factions, and... i know only how to create movable gates for all players, just anyone can type cmd and gates are opened, but it is a Filterscript. Here is Filterscript code, but that gates can open anyone, just need to type cmd, please someone who are smarter than me on scripting things, change this code a bit, so only Yamaguchi can open thoose gates. I rly appreaciate it.
Код:
#include <a_samp>
#define FILTERSCRIPT
new yamaguchigates1;
public OnFilterScriptInit()
{
print("\n******************************************************");
print("* *");
print("* Simple Movable Gates Filterscript *");
print("* *");
print("******************************************************\n");
yamaguchigates1 = CreateObject(980, 785.09997558594, -1152.4000244141, 25.299999237061, 0, 0, 270, 100.0);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/go", true)){
if(IsPlayerInRangeOfPoint(playerid, 15, 785.09997558594, -1152.4000244141, 25.299999237061)){
MoveObject(yamaguchigates1, 785.40002441406, -1162.9000244141, 25.39999961853, 3.0, 0.0, 0.0, 270);
return 1;
}
}
else if(strcmp(cmdtext, "/close", true)){
if(IsPlayerInRangeOfPoint(playerid, 15, 785.09997558594, -1152.4000244141, 25.299999237061)){
MoveObject(yamaguchigates1, 785.09997558594, -1152.4000244141, 25.299999237061, 3.0, 0.0, 0.0, 270);
return 1;
}
}
return 0;
}
public OnFilterScriptExit()
{
return 1;
}
Код:
//===============================Include Files==================================
#define TEAM_14 14
#include <a_samp>
#define Team_14
#include <a_players>
#define FILTERSCRIPT
#define GREY 0xc8bebeAA
#define COLOR_GREY 0xc8bebeAA
#define COLOR_LIME 0x99FF00AA
#define COLOR_RED 0xAA3333AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_GRAD1 0xB4B5B7AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x0000FFAA
#define COLOR_YELLOW 0xFFFF00AA
#pragma tabsize 0
new gate;
#define FILTERSCRIPT
#if defined FILTERSCRIPT
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, COLOR_YELLOW, "");
SendClientMessage(playerid, COLOR_YELLOW, "");
return 1;
}
public OnFilterScriptInit()
{
AddStaticPickup(1318, 2, 1122.5795898438,-2037.013671875,69.892913818359); // HQ icon
Create3DTextLabel("Yamaguchi Mafia",0xAA3333AA,1122.5795898438,-2037.013671875,69.892913818359+0.75,20.0,0,1);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Gates");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
gate = CreateObject(2933, 2473.78808594, -1691.76757812, 14.23004055, 0.00000000, 0.00000000, 18, 0.00000000); // gate
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 2473.8220214844, -1690.8035888672, 15.244583129883);
SetPlayerCameraPos(playerid, 2473.8220214844, -1690.8035888672, 15.244583129883);
SetPlayerCameraLookAt(playerid, 2473.8220214844, -1690.8035888672, 15.244583129883);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/open", true)==0) // Command
if(GetPlayerTeam(playerid) !=14)
{
MoveObject (gate,2478.1059570313,-1695.9339599609,14.231301307678,2); // Gate (open)
SendClientMessage(playerid, COLOR_GREEN, "Gate is open!");
return 1;
}
if (strcmp(cmdtext, "/close", true)==0)
{
if(GetPlayerTeam(playerid) !=14)
MoveObject (gate,2473.78808594,-1691.76757812,14.23004055,2); // Gate (close)
SendClientMessage(playerid, COLOR_RED, "Gate is close!");
return 1;
}
if(!strcmp(cmdtext, "/gate", true)) // commands
{
SendClientMessage(playerid, COLOR_YELLOW, "/open - open");
SendClientMessage(playerid, COLOR_YELLOW, "/close - close");
return 1;
}
return 0;
}

I use Raven's rp gamemode v4.2
Cya ppls, again soory for bad Eng.


ill try it right now.