Open only faction
#1

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

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(playeridCOLOR_YELLOW"");
    
SendClientMessage(playeridCOLOR_YELLOW"");
    return 
1;
}
public 
OnFilterScriptInit()
{
    
AddStaticPickup(131821122.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(playeridclassid)
{
    
SetPlayerPos(playerid2473.8220214844, -1690.803588867215.244583129883);
    
SetPlayerCameraPos(playerid2473.8220214844, -1690.803588867215.244583129883);
    
SetPlayerCameraLookAt(playerid2473.8220214844, -1690.803588867215.244583129883);
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp(cmdtext"/groveo"true)==0// Command
       
{
      
MoveObject (gate,2478.1059570313,-1695.9339599609,14.231301307678,2); // Gate (open)
      
SendClientMessage(playeridCOLOR_GREEN"Gate is open!");
      return 
1;
       }
    if (
strcmp(cmdtext"/grovec"true)==0)
       {
   
MoveObject (gate,2473.78808594,-1691.76757812,14.23004055,2); // Gate (close)
   
SendClientMessage(playeridCOLOR_RED"Gate is close!");
   return 
1;
       }
    if(!
strcmp(cmdtext"/grove"true)) // commands
    
{
        
SendClientMessage(playeridCOLOR_YELLOW"/groveo - open");
        
SendClientMessage(playeridCOLOR_YELLOW"/grovec - close");
        return 
1;
       }
    return 
0;

Reply
#2

We must see how you defined faction number 14 in your gamemode ...
Reply
#3

do smthing like this

if(faction != 14) return SendClientMessage...

replace the faction var with the var you use
Reply
#4

Faction name is Mafia , its faction 14
Reply
#5

Any can help?
i need gates who can open ONLY faction member , INgame its faction nummber 14
INgame faction name is Mafia
Someone can made ? pleasee
Reply
#6

THE_KNOWN, has told you how to do that.

pawn Код:
if(strcmp(cmdtext, "/groveo", true)==0) // Command
{
    if(Your table is called the Faction != 14)return SendClientMessage(playerid, YOUR_COLOR_COMMAND, "* You're not in faction Groove Street.");
    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)
{
    if(Your table is called the Faction != 14)return SendClientMessage(playerid, YOUR_COLOR_COMMAND, "* You're not in faction Groove Street.");
    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;
}
Reply
#7

OK i do that , but i dont undarstand yet how can i define, ok watch :

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(playeridCOLOR_YELLOW"");
    
SendClientMessage(playeridCOLOR_YELLOW"");
    return 
1;
}
public 
OnFilterScriptInit()
{
    
AddStaticPickup(131821122.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(playeridclassid)
{
    
SetPlayerPos(playerid2473.8220214844, -1690.803588867215.244583129883);
    
SetPlayerCameraPos(playerid2473.8220214844, -1690.803588867215.244583129883);
    
SetPlayerCameraLookAt(playerid2473.8220214844, -1690.803588867215.244583129883);
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
 if (
strcmp(cmdtext"/groveo"true)==0// Command
       
{
       if(
grove gang != 14)return SendClientMessage(playeridCOLOR_RED"* You're not in faction Groove Street.");
      
MoveObject (gate,2478.1059570313,-1695.9339599609,14.231301307678,2); // Gate (open)
      
SendClientMessage(playeridCOLOR_GREEN"Gate is open!");
      return 
1;
       }
    if (
strcmp(cmdtext"/grovec"true)==0)
       {
   if(
grove gang != 14)return SendClientMessage(playeridCOLOR_RED"* You're not in faction Groove Street.");
   
MoveObject (gate,2473.78808594,-1691.76757812,14.23004055,2); // Gate (close)
   
SendClientMessage(playeridCOLOR_RED"Gate is close!");
   return 
1;
       }
    if(!
strcmp(cmdtext"/grove"true)) // commands
    
{
        
SendClientMessage(playeridCOLOR_YELLOW"/groveo - open");
        
SendClientMessage(playeridCOLOR_YELLOW"/grovec - close");
        return 
1;
       }
    return 
0;


i got errors :

error 017: undefined symbol "grove"
error 017: undefined symbol "gang"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

Make ready this, plss
Reply
#8

Any help ?
Reply
#9

You haven't got it defined anywhere.
Reply
#10

pawn Код:
#define TEAM_14 14 // at the top

public OnPlayerCommandText(playerid, cmdtext[])
{
 if (strcmp(cmdtext, "/groveo", true)==0) // Command


       {
       if(GetPlayerTeam(playerid) != TEAM_14) return SendClientMessage(playerid, COLOR_RED, "* You're not in faction Groove Street.");
      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)
       {
   if(GetPlayerTeam(playerid) != TEAM_14) return SendClientMessage(playerid, COLOR_RED, "* You're not in faction Groove Street.");
   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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)