[Tutorial] How to make movable gate and openable for only 1 name.
#1

Quote:

#include <zcmd>

First of all you have to make one object that will be gate, my example is this:

Код:
CreateObject(987,1806.09997559,-1353.80004883,14.19999981,0.00000000,0.00000000,90.00000000);
That is just regular fence, then you have to create global variable
Make it above your OnGameModeInt

Код:
new gate;
This is the error you will get:

Код:
C:\Users\Mario\Desktop\lol\gamemodes\kuca.pwn(718) : warning 203: symbol is never used: "gate"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

1 Warning.
Then you have to do this:

Код:
gate = CreateObject(987,1806.09997559,-1353.80004883,14.19999981,0.00000000,0.00000000,90.00000000);
Make that below OnGameModeInt

After that you will get this error:

Код:
C:\Users\Mario\Desktop\lol\gamemodes\kuca.pwn(79) : warning 204: symbol is assigned a value that is never used: "gatee"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
All you have to do is:

Код:
new gate;

public OnGameModeInit()
{
     gate = CreateObject(987,1806.09997559,-1353.80004883,14.19999981,0.00000000,0.00000000,90.00000000); //object(elecfence_bar)
     return 1;
}
This may be little too much detail but it will make new scripters understand...

You will still get error so you gotta do this;

Код:
CMD:opengate(playerid,params[])
{
    MoveObject(gate,1808.00000000,-1354.19995117,7.89999962, 1.500000);
    SendClientMessage(playerid, COLOR_GREEN, "You have succesfully openned the gate!");
    return 1;
}
I use zcmd to make commands, its easy way.
if you use it too, put this at top of your script
Код:
#include <zcmd>
Now let me explain the command
Код:
CMD:opengate(playerid,params[])
This is to make command, the basic.
Код:
MoveObject(gate,1808.00000000,-1354.19995117,7.89999962, 1.500000);
This is to move object "gate" you have made. It moves it down.
Код:
MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed);
http://www.we-r-here.com/cad_07/tuto...s/xyz_axes.gif
That is link to learn it.

So you got X Y Z at CreateObject too, so if you want to move down the object ou just low the Z. Example:
This is Z= 15.89999962 So if you want to move object down u change that to 7.89999962..

Now you have moved the gate down, now let me teach you how to put it back up!
You do all the same:

Код:
CMD:closegate(playerid,params[])
{
    MoveObject(gate,1806.09997559,-1353.80004883,14.19999981, 1.500000);
    SendClientMessage(playerid, COLOR_GREEN, "You have succesfully closed the gate!");
    return 1;
}
You do all the same, but now you move object up, so you put Z how it was at CreateObject..
If you want just one name can open the gate, you put this:
Код:
CMD:opengate(playerid,params[])
{
   new PlayerName[24];
   GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
   if(strcmp(PlayerName,"NAME",true))
   {
     SendClientMessage(playerid, COLOR_RED, "Only NAME can open the gate!");
   }
   MoveObject(gate,1808.00000000,-1354.19995117,7.89999962, 1.500000);
   SendClientMessage(playerid, COLOR_GREEN, "You have succesfully openned the gate!");
   return 1;
}
I hope you learned something from my lame english..
Reply
#2

this is okay for non beginners but if you want to improve you should explain WHY
your doing what ya doing, not just what you need todo.

for the beginners you really need to add more info!
any non beginner can do this without a tut,

4/10!
Reply
#3

Well i think i explained alot of things, this is for little better scripters that needs help, not for noob scripters.
Noob scripters can understands this too,
Reply
#4

well thats the thing.. this is easy!!!
Iv been into pawn for a month maybe!!! and could have done this in my first week.

only noobies will need it..
you explain WHAT todo not why you should do it..

i am not trying to insult you at all!
I know its alot of work to write up and try to teach to someone.
Just trying to give a few pointers is all.

regards,
Reply
#5

Tutorial are for beginers..
Reply
#6

It's slightly pointless to use zcmd for just two commands... But if you're using a filterscript, it makes sense, though you should use #define filterscript - so zcmd knows it's processing a filterscript.

Quote:

You will still get error so you gotta do this;

I presume it's a warning, not an error. "gate has not been used" is not something that would cause an error.

You could've used a #define for the name or a variable so it would be more dynamic, this would cover defines/macros a little more for new scripters and it would be easier for them to update.

Quote:
Originally Posted by Kakioshe22
Посмотреть сообщение
Tutorial are for beginers..
Not all tutorials are for beginners, tutorials come out frequently which explain parts of Pawn that the majority of us don't know, for example there's one for making plugins, there's one explaining #emit and there's loads of other good tutorials for things that you don't pick up when you begin scripting.
Reply
#7

If you think you dont need this, dont read it, i was just trying to be helpfull
Reply
#8

I'm not trying to be rude, I'm trying to point out ways you could improve your tutorial. You should be open to constructive criticism, it's not like I've just randomly started insulting all of your work in here.
Reply
#9

Why nothing happen?
pawn Код:
new gate;  
public OnGameModeInit()
{
    CreateObject(3415,-769.79998779,1091.69995117,43.29999924,0.00000000,0.00000000,0.00000000); //object(ce_loghut1) (1)
    gate = CreateObject(2395,-770.00000000,1089.69995117,40.09999847,0.00000000,0.00000000,90.00000000); //object(cj_sports_wall) (1)
    return 1;
}

CMD:Openit(playerid,params[])
{
    MoveObject(gate,-770.00000000,1089.69995117,40.09999847, 1.500000);
    SendClientMessage(playerid, COLOUR_GREEN, "You have succesfully openned the gate!");
    return 1;
}
CMD:closeit(playerid,params[])
{
    MoveObject(gate,-770.00000000,1089.69995117,30.09999847, 1.500000);
    SendClientMessage(playerid, COLOUR_GREEN, "You have succesfully closed the gate!");
    return 1;
}
I compiled without errors or warnings
Reply
#10

Quote:
Originally Posted by Wickeed
Посмотреть сообщение
Why nothing happen?
pawn Код:
new gate;  
public OnGameModeInit()
{
    CreateObject(3415,-769.79998779,1091.69995117,43.29999924,0.00000000,0.00000000,0.00000000); //object(ce_loghut1) (1)
    gate = CreateObject(2395,-770.00000000,1089.69995117,40.09999847,0.00000000,0.00000000,90.00000000); //object(cj_sports_wall) (1)
    return 1;
}

CMD:Openit(playerid,params[])
{
    MoveObject(gate,-770.00000000,1089.69995117,40.09999847, 1.500000);
    SendClientMessage(playerid, COLOUR_GREEN, "You have succesfully openned the gate!");
    return 1;
}
CMD:closeit(playerid,params[])
{
    MoveObject(gate,-770.00000000,1089.69995117,30.09999847, 1.500000);
    SendClientMessage(playerid, COLOUR_GREEN, "You have succesfully closed the gate!");
    return 1;
}
I compiled without errors or warnings
What happends when you try to open it?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)