/open and /close don't work.
#1

pawn Код:
CreateObject(2990,2479.87768555,-1720.38623047,16.46136665,0.00000000,0.00000000,179.99993896); //object(wongs_gate) (1)
pawn Код:
if (strcmp("/open", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, 0xFFCFFF, " You've opened the gate please close it ");
        MoveObject(2990,2479.87768555,-1720.38623047,16.46136665,0.00000000,0.00000000,179.99993896,1);
        SetTimer("close", 10000, 0);//the gate will close after 10 seconds
       
       return 1;
    }
if (strcmp("/close", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, 0xFFCFFF, " You've closed the gate thanks for closing it ");
        MoveObject(2990,2479.87768555,-1720.38623047,16.46136665,0.00000000,0.00000000,179.99993896,0);
What i've to do.
Reply
#2

all your X,Y,Z is the same

you need the one for open to be the X. Y, Z, Angel of the gate once its opened.
Reply
#3

pawn Код:
//on top
new IsOpened,Gate;

//OnGameModeinit
Gate = CreateObject(2990,2479.87768555,-1720.38623047,16.46136665,0.00000000,0.00000000,179.99993896);
IsOpened=0;
pawn Код:
if (strcmp("/open", cmdtext, true, 10) == 0)
    {
        if(IsOpened == 1) return SendClientMessage(playerid, 0xFFFCFFF, " The Gate Is Already Opened ");
        IsOpened =1;
        SendClientMessage(playerid, 0xFFFCFFF, " You've opened the gate please close it ");
        MoveObject(Gate,2479.87768555,-1720.38623047,10.46136665,3.00,0.00000000,0.00000000,179.99993896);
        SetTimer("close", 10000, 0);//the gate will close after 10 seconds
       
       return 1;
    }
if (strcmp("/close", cmdtext, true, 10) == 0)
    {
        if(IsOpened == 0) return SendClientMessage(playerid, 0xFFFCFFF, " The Gate Is Already Closed ");
        IsOpened =0;
        MoveObject(Gate,2479.87768555,-1720.38623047,16.46136665,3.00,0.00000000,0.00000000,179.99993896);
     }

pawn Код:
forward close();
public close()
{
     If(IsOpened == 1)
     {      
           MoveObject(Gate,2479.87768555,-1720.38623047,16.46136665,3.00,0.00000000,0.00000000,179.99993896);
           IsOpened=0;
     }
}
Reply
#4

Firstly your X,Y,Z are all the same as the above poster has posted. Secondly, you need to show what object your moving e.g. Gate = CreateDynamicObject and MoveObject(Gate,...)

This should help: https://sampforum.blast.hk/showthread.php?tid=332956
Reply
#5

What is the DynamicObject i donno it.
Reply
#6

@Huss3an
pawn Код:
AMEMO~1\s.pwn(43) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(43) : error 017: undefined symbol "IsOpened"
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(43) : warning 215: expression has no effect
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(43) : error 017: undefined symbol "Gate"
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(45) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(55) : warning 202: number of arguments does not match definition
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(56) : warning 202: number of arguments does not match definition
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(57) : warning 213: tag mismatch
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(106) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(112) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(117) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(119) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(122) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(127) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(129) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(132) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(137) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(139) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(141) : error 017: undefined symbol "IsOpened"
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(142) : error 017: undefined symbol "IsOpened"
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(142) : warning 215: expression has no effect
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(144) : error 017: undefined symbol "Gate"
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(147) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(151) : error 017: undefined symbol "IsOpened"
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(152) : error 017: undefined symbol "IsOpened"
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(152) : warning 215: expression has no effect
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(153) : error 017: undefined symbol "Gate"
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(155) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(158) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(160) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(163) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(165) : warning 217: loose indentation
C:\DOCUME~1\admin\Desktop\NEWFOL~3\GAMEMO~1\s.pwn(169) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


8 Errors.
Reply
#7

See.
Reply
#8

show ur code ,how and where did you add the lines
Reply
#9

Try
pawn Код:
new IsOpened[MAX_PLAYERS];

if(IsOpened[playerid] == 1) return SendClientMessage(playerid, 0xFFFCFFF, " The Gate Is Already Opened ");
Reply
#10

Quote:
Originally Posted by newbienoob
Посмотреть сообщение
Try
pawn Код:
new IsOpened[MAX_PLAYERS];

if(IsOpened[playerid] == 1) return SendClientMessage(playerid, 0xFFFCFFF, " The Gate Is Already Opened ");
Thats wrong!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)