PD gates. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: PD gates. (
/showthread.php?tid=196556)
PD gates. -
iGetty - 05.12.2010
How would i be able to add a Police gate to the pd thing, to stop people getting in, and how would i create a command for only Police to use, and where in the script would i put it all? Thank-you for all your help, i know i'm probably getting annoying with all this, but, again, thanks.
Re: PD gates. -
iGetty - 05.12.2010
Bump. please answer?
Re: PD gates. -
Alex_Valde - 05.12.2010
Please read the
rules!
Quote:
b) Do not bump
Some people apparently think they are important enough to bump their own topic after 10 minutes.
You can bump topics when the last reply is at least 48 hours old, and it needs to have useful information about your problem.
|
Anyways, You'll need to create your gates. Use MTA SA to put them where you want.
Than you'll need to get the coordinates of opened gates.
Than you need to define teams like
new TeamPolice = 5
And then....
pawn Код:
//Please note that this is only an example none of this codes will work.
if( is player in that team )
{
move object
settimer or something else
}
This I explained everything very quickly 'cause you didn't even created the gates so your still at zero with this.
When you create that all I will be glad to help you out with that.
Re: PD gates. -
iGetty - 05.12.2010
Quote:
Originally Posted by Alex_Valde
Please read the rules!
Anyways, You'll need to create your gates. Use MTA SA to put them where you want.
Than you'll need to get the coordinates of opened gates.
Than you need to define teams like new TeamPolice = 5
And then....
pawn Код:
//Please note that this is only an example none of this codes will work. if( is player in that team ) { move object settimer or something else }
This I explained everything very quickly 'cause you didn't even created the gates so your still at zero with this.
When you create that all I will be glad to help you out with that. ![Smiley](images/smilies/smile.png)
|
Sorry for bumping
![Sad](images/smilies/sad.gif)
, So if i create the gates? Would you please help me? As i have no clue as to what to do.
Thanks.
Re: PD gates. - rjjj - 05.12.2010
You can use MTA Editor to create the gates and after save the maps, you just convert to Pawn code and put in your GM/FS.
About the commands, you can create a variable to be used by some players:
pawn Код:
new IsAPoliceMan[MAX_PLAYERS];//It is equal to 0.
pawn Код:
if (strcmp("/police1", cmdtext, true, 6) == 0)
{
IsAPoliceMan[playerid] = 1;//The variable is now equal to 1 for the command user
return 1;
}
and:
pawn Код:
if(strcmp("/cop", cmdtext, true, 10) == 0)
{
if(IsAPoliceMan[playerid] == 1)//It checks the level of the variable is 1 for the command user
{
SendClientMessage(playerid, 0xFFFFFFAA, "You are a police officer!");
}
return 1;
}
I hope i have helped
Re: PD gates. -
Alex_Valde - 05.12.2010
Sure I'll help you out.
Just please create gates where you want and have their coordinates, and also when they are open.
Those two are main in that code.
Re: PD gates. -
iGetty - 05.12.2010
Quote:
Originally Posted by rjjj
You can use MTA Editor to create the gates and after save the maps, you just convert to Pawn code and put in your GM/FS.
About the commands, you can create a variable to be used by some players:
pawn Код:
new IsAPoliceMan[MAX_PLAYERS];//It is equal to 0.
pawn Код:
if (strcmp("/police1", cmdtext, true, 6) == 0) { IsAPoliceMan[playerid] = 1;//The variable is now equal to 1 for the command user return 1; }
and:
pawn Код:
if(strcmp("/cop", cmdtext, true, 10) == 0) { if(IsAPoliceMan[playerid] == 1)//It checks the level of the variable is 1 for the command user { SendClientMessage(playerid, 0xFFFFFFAA, "You are a police officer!"); } return 1; }
I hope i have helped ![Cheesy](images/smilies/biggrin.png)
|
You have helped a great lot, but i'm really stuck, When i map the gates, how do i map a closed one? And when i have finished it, do you fancy helping me in full detail tomorrow? Thank-you. Callum
Re: PD gates. -
scripter1 - 05.12.2010
A closed gate would block the place that your trying to cover. The open gate, could just go down.
And here's a link to creating moving objects -
https://sampforum.blast.hk/showthread.php?tid=195131