04.03.2011, 14:48
hy, how do i make, the only faction , example 14 , faction nummber 14 can open the gate ?
please make in this script that, only faction nummber 14 can open the gate
please make in this script that, only faction nummber 14 can open the gate
PHP код:
/*
Credits goes to:
[SAP]Sidhu, for his awesome idea and programming!
[SAP]Sidhu Made this
DO NOT REMOVE THE STUFF ABOVE, ANY ATTEMP TO DO SO WILL RESULT IN YOU PAYING THE CONSEQUENCES IF CAUGHT
*/
//===============================Include Files==================================
#include <a_samp>
#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;
// This is a comment
// uncomment the line below if you want to write a filterscript
//#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("Grove street gang",0xFF9F40FF,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,180.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, "/groveo", true)==0) // Command
{
MoveObject (gate,2478.1059570313,-1695.9339599609,14.231301307678,2); // Gate (open)
SendClientMessage(playerid, COLOR_GREEN, "Gate is open!");
return 1;
}
if (strcmp(cmdtext, "/grovec", true)==0)
{
MoveObject (gate,2473.78808594,-1691.76757812,14.23004055,2); // Gate (close)
SendClientMessage(playerid, COLOR_RED, "Gate is close!");
return 1;
}
if(!strcmp(cmdtext, "/grove", true)) // commands
{
SendClientMessage(playerid, COLOR_YELLOW, "/groveo - open");
SendClientMessage(playerid, COLOR_YELLOW, "/grovec - close");
return 1;
}
return 0;
}