Moveable gate. -
Kyle. - 06.02.2011
pawn Код:
CreateObject(11102, 1208.1774902344, -1475.3129882813, 18.008708953857, 0, 0, 0);//opened gate
CreateObject(11102, 1208.1774902344, -1475.3129882813, 14.548282623291, 0, 0, 0);//closed gate
Using those two positions, how would I make a movable gate by typing /gateopen and to close it with /gateclose.
If you could please make it for me.
Re: Moveable gate. -
Kyle. - 06.02.2011
Bump.
Re: Moveable gate. -
HyperZ - 06.02.2011
https://sampwiki.blast.hk/wiki/MoveObject
Re: Moveable gate. -
Kyle. - 06.02.2011
I'm still fairly new to scripting, could someone make me it?
Re: Moveable gate. -
fangoth1 - 06.02.2011
ok first you need to put this under your defines
then under OnGameModeInit
pawn Код:
gatenamehere = CreateObject(11102, 1208.1774902344, -1475.3129882813, 18.008708953857, 0, 0, 0);
pawn Код:
if(strcmp(cmdtext,"/opengate", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 15, 1208.1774902344, -1475.3129882813, 18.008708953857))
{
MoveObject(gatenamehere, 1208.1774902344, -1475.3129882813, 18.008708953857, 15);//how fast it moves is speed
return 1;
}
}
if(strcmp(cmdtext,"/closegate", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 15, 1208.1774902344, -1475.3129882813, 18.008708953857))
{
MoveObject(gatenamehere, 1208.1774902344, -1475.3129882813, 18.008708953857, 0, 0, 0, 15);
}
return 1;
}
CreateObject(11102, 1208.1774902344, -1475.3129882813, 18.008708953857, 0, 0, 0);//opened gate
CreateObject(11102, 1208.1774902344, -1475.3129882813, 14.548282623291, 0, 0, 0);//closed gate
Re: Moveable gate. -
Kyle. - 06.02.2011
I gave the cords, can you insert them for me? Cause, I tried to do that all myself, and failed.
Re: Moveable gate. -
fangoth1 - 06.02.2011
.... its really easy lol
Re: Moveable gate. -
Kyle. - 06.02.2011
Well you see, with 2 - 3 days of scripting experience it's not so much easy for me.
Could you pretty please..
With a cherry ontop?? =)
Re: Moveable gate. -
fangoth1 - 06.02.2011
there i edited
Re: Moveable gate. -
Kyle. - 06.02.2011
pawn Код:
if(strcmp(cmdtext,"/opengate", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 15,11102, 1208.1774902344, -1475.3129882813, 18.008708953857))
{
MoveObject(gatenamehere, 11102, 1208.1774902344, -1475.3129882813, 18.008708953857, 15);//how fast it moves is speed
return 1;
}
if(strcmp(cmdtext,"/closegate", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 15, 11102, 1208.1774902344, -1475.3129882813, 18.008708953857))
{
MoveObject(gatenamehere, 11102, 1208.1774902344, -1475.3129882813, 18.008708953857, 0, 0, 0, 15);
}
return 1;
}
Код:
C:\Users\Kyle\Desktop\pawno\gamemodes\testserver.pwn(303) : warning 202: number of arguments does not match definition
C:\Users\Kyle\Desktop\pawno\gamemodes\testserver.pwn(305) : warning 202: number of arguments does not match definition
C:\Users\Kyle\Desktop\pawno\gamemodes\testserver.pwn(308) : warning 217: loose indentation
C:\Users\Kyle\Desktop\pawno\gamemodes\testserver.pwn(310) : warning 202: number of arguments does not match definition
C:\Users\Kyle\Desktop\pawno\gamemodes\testserver.pwn(312) : warning 202: number of arguments does not match definition
C:\Users\Kyle\Desktop\pawno\gamemodes\testserver.pwn(312) : warning 202: number of arguments does not match definition
C:\Users\Kyle\Desktop\pawno\gamemodes\testserver.pwn(312) : warning 202: number of arguments does not match definition
C:\Users\Kyle\Desktop\pawno\gamemodes\testserver.pwn(312) : warning 202: number of arguments does not match definition
C:\Users\Kyle\Desktop\pawno\gamemodes\testserver.pwn(314) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
9 Warnings.
It didn't work I included all the other things you said also.
Heres a SS: