[Tutorial] How to make a gate opens by name
#1

Hello sa-mp . This Tutorial is how you can make a gate that opens by a name.
1-open pawno and make a new blankscript.
2-
Quote:

include <a_samp>

you should write this in the second line
2-
Quote:

new GateID[1];

you should write this inj the 4th line
4-
Quote:

public OnFilterScriptInit()

if you want it as a FS. write this in the 6th line
5-
Quote:

{

write this in the 7th line so u dont get an error
6-
Quote:

GateID[1] = CreateObject(object id, pos=x, pos=y, pos=z, rotate=x, rotate=y, rotate=z, 100.0);
GateID[2] = CreateObject(object id, pos=x, pos=y, pos=z, rotate=x, rotate=y, rotate=z, 100.0);

write those on line 9 and 10
7-
Quote:

return 1;

write this on line 12
8-
Quote:

}

write this on line 13
9-
Quote:

public OnFilterScriptExit()

write this on line 15
10-
Quote:

{

on line 16
11-
Quote:

return 1;

on line 17
12-
Quote:

}

on line 18
13-
Quote:

public OnPlayerUpdate(playerid)

on line 20
14-
Quote:

{

on line 21
15-
Quote:

new pname[24],YourName[128];
format(YourName,128,"namehere"); // Put Your Name Here
GetPlayerName(playerid,pname,24);

on line 22,23,24
16-
Quote:

if(!strcmp(YourName,pname,true) && IsPlayerInRangeOfPoint(playerid, 3.0, 1535.00000000,-1451.30004883,12.39999962)) {

on line 25
17-
Quote:

MoveObject(GateID[1], 1539.69995117,-1451.30004883,12.39999962,10);
MoveObject(GateID[2], 1529.80004883,-1451.30004883,12.39999962,10);

on line 26 and 27
18-
Quote:

}else {

on line 28
19-
Quote:

MoveObject(GateID[1], 1535.00000000,-1451.30004883,12.39999962,10);
MoveObject(GateID[2], 1534.80004883,-1451.30004883,12.39999962,10);

on line 29 30
20-
Quote:

}
return 1;
}

on line 31 32 33
Reply
#2

Nice guide, I'm sure it will come in handy for some people.

Only one thing, instead of writting under a certain line, next time you should do it under the public. or w/e it's called.
Reply
#3

You lose 6.5 bytes on this.
When you define your field never build it new gateID [1] and then use gateID [1].
Cells maybe used for example.
new gateID [1]Gate [0] = ...is wrong:new gate [1];Gate [1] = ...
it will throw error.
Reply
#4

Not a tutorial, you are just telling people to copy and paste.
Reply
#5

Learn to press tab.
Reply
#6

Thanks all of you for the advice
but i hope it helped
Reply
#7

instend of telling us what we write in each line , why don't you paste the whole code and then explain everything because the only thing i understand in this thread is line 1 . line 2 . line 3
Reply
#8

....
Reply
#9

mabye explain it more
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)