How to make a gate openable only by cops? -
Karl1195 - 13.08.2010
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.
Re: How to make a gate openable only by cops? -
Mike_Peterson - 13.08.2010
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?
Re: How to make a gate openable only by cops? -
Karl1195 - 13.08.2010
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?
Re: How to make a gate openable only by cops? -
keessie - 13.08.2010
nvm i was to late :P
Re: How to make a gate openable only by cops? -
Karl1195 - 13.08.2010
i want these skins if possible
Skin Ids:
287 / 186 / 288
if not possible do just 288
Re: How to make a gate openable only by cops? -
Karl1195 - 13.08.2010
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?
Re: How to make a gate openable only by cops? -
Mike_Peterson - 13.08.2010
Karl, im currently figuring something :P i cant seem to find it...
Re: How to make a gate openable only by cops? -
Karl1195 - 13.08.2010
it's okay =]
Re: How to make a gate openable only by cops? -
rbN. - 13.08.2010
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..
Re: How to make a gate openable only by cops? -
Mike Garber - 13.08.2010
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.