How to make a gate openable only by cops?
#1

Okay i made a gate for my prison it's very cool... =] i learned how to do single gates now but i wanna learn how to do gates that can only be opened by The faction number.. i was kinda looking arround and i was trying to add this in the filterscript:

Код:
if(TeamOfCops[playerid]==1 || TeamOfArmy[playerid]==3)
{
but i had like 4 errors so i don't think it's the right script for my filterscript.

This is the Script:


Код:
//by: Karl1195
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

new gate;

public OnFilterScriptInit()
{
				gate = CreateObject(988,1781.16040039,-1534.00585938,8.56611252,0.00000000,0.00000000,87.33950806); //(ws_apgate) Yard 1 close
				return 1;
}

#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
        if(strcmp("/closeyardgate", cmdtext, true))
        {
                MoveObject(gate,1781.16040039, -1534.00585938, 9, 2);
				return 1;
        }
        if(strcmp("/openyardgate", cmdtext, true))
        {
                MoveObject(gate,1781.18664551,-1533.96008301, 11.65782928, 2);
				return 1;
        }
		return 0;
}
Thanks again.. and again

Karl1195.
Reply
#2

uhhm, someone probably is faster then me but i could script this for you:
when player is the cop skin... open the gate.. when player is not cop skin.... return You're not allowed to use this gate.
aight?
Reply
#3

yah sure it's great in deed because it's a prison!!! so if some one wear a police clothes they won't know and he can enter... can you make a send message thing so who write /openyardgate and he is not wearing the clothes says Your not wearing cop clothes or some thing?
Reply
#4

nvm i was to late :P
Reply
#5

i want these skins if possible

Skin Ids:

287 / 186 / 288


if not possible do just 288
Reply
#6

ahh it's good like that too my game mode works like this


Код:
if(IsAPDMember(playerid) || IsAFreecop(playerid))
{
it's a filter script so it won't compile like that because it don't know what type of gamemode ur using?
Reply
#7

Karl, im currently figuring something :P i cant seem to find it...
Reply
#8

it's okay =]
Reply
#9

pawn Код:
if(strcmp("/openyardgate", cmdtext, true))
        {
                if(GetPlayerSkin(playerid) = 288)
                {
                    MoveObject(gate,1781.18664551,-1533.96008301, 11.65782928, 2);
                }
                else
                {
                    SendClientMessage(playerid, COLOR_RED, "This command is only for cops!");
                }
                return 1;
        }
and
pawn Код:
if(strcmp("/closeyardgate", cmdtext, true))
        {
                if(GetPlayerSkin(playerid) = 288)
                {
                    MoveObject(gate,1781.16040039, -1534.00585938, 9, 2);
                }
                else
                {
                    SendClientMessage(playerid, COLOR_RED, "This command is only for cops!");
                }
                return 1;
        }
Or something like that..
Reply
#10

Quote:
Originally Posted by Karl1195
Посмотреть сообщение
yah sure it's great in deed because it's a prison!!! so if some one wear a police clothes they won't know and he can enter... can you make a send message thing so who write /openyardgate and he is not wearing the clothes says Your not wearing cop clothes or some thing?
I would say It aint realistic, as he would have to go through alot of guarded doors, with a security card, and locked doors before being able to even get down there.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)