09.04.2012, 15:23
Quote:
#include <zcmd> |
Код:
CreateObject(987,1806.09997559,-1353.80004883,14.19999981,0.00000000,0.00000000,90.00000000);
Make it above your OnGameModeInt
Код:
new gate;
Код:
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.
Код:
gate = CreateObject(987,1806.09997559,-1353.80004883,14.19999981,0.00000000,0.00000000,90.00000000);
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.
Код:
new gate; public OnGameModeInit() { gate = CreateObject(987,1806.09997559,-1353.80004883,14.19999981,0.00000000,0.00000000,90.00000000); //object(elecfence_bar) return 1; }
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; }
if you use it too, put this at top of your script
Код:
#include <zcmd>
Код:
CMD:opengate(playerid,params[])
Код:
MoveObject(gate,1808.00000000,-1354.19995117,7.89999962, 1.500000);
Код:
MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed);
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; }
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; }