[Tutorial] Creat automatically gates from zcmd
#1

So, let's start

add this to mod start after forward's and define's:
PHP Code:
new ao
now add our object to public OnPlayerGameInit() :
PHP Code:
ao CreateObject(18783,2761.6459961,1183.8050537,12.3129997,90.0000000,180.0054932,269.9670410);// this closed gate position 
create a command for opening gates:

PHP Code:
CMD:agateopen(playeridparams[]) 

SendClientMessage(playerid,0xFFFFFFFF,"You open a gate, they closed after 15 sec.");
MoveObject(ao2761.6459961,1183.8050537,27.3129997,5.00); // Open gate position(they opening up)
SetTimer("agate"150000); //timer for 15 sec
return 1

create time public:

add this to mod start:

PHP Code:
forward agate(playerid); 
and they public:

PHP Code:
public agate(playerid

MoveObject(ao2761.6459961,1183.8050537,12.3129997,5.00); // Close gate position(x,y,z from ongamemodeinit) 
SendClientMessage(playerid,0xFFFFFFFF,"Gate is closed."); 
return 
1

*Replace all coords(x,y,z)


Sorry for my bad knowledge of English
Reply
#2

Very helpfull for beginners thanks!
Reply
#3

you should have explained it ...

what u did is just copy paste ...

anyway , good for the one who knows scripting but very advanced/difficult for newbie's .
Reply
#4

use [pawn ] [/pawn ] codes :S
not php codes
but, it's nice 4.5/10
Reply
#5

Quote:
Originally Posted by An0nYm0uS
View Post
you should have explained it ...

what u did is just copy paste ...

anyway , good for the one who knows scripting but very advanced/difficult for newbie's .
i am author, no copy, no paste. this gates from my server.
Reply
#6

Quote:
Originally Posted by Rafael_Zambrano
View Post
use [pawn ] [/pawn ] codes :S
not php codes
but, it's nice 4.5/10
same
Reply
#7

Is not that good, also you did some mistakes
If you type this:
pawn Code:
SetTimer("agate", 15000, 0); //timer for 15 sec
, that means this timer function doesn't have any parameter:
you should do:
pawn Code:
SetTimerEx("agate", 15000, 0, "i", playerid);
Anyway 1/5 for the tutorial:
- Mistakes ( - 2 p )
- Not Good Explained ( - 2p)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)