Moveable gate.
#1

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.
Reply
#2

Bump.
Reply
#3

https://sampwiki.blast.hk/wiki/MoveObject
Reply
#4

I'm still fairly new to scripting, could someone make me it?
Reply
#5

ok first you need to put this under your defines
pawn Код:
new gatenamehere;
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
Reply
#6

I gave the cords, can you insert them for me? Cause, I tried to do that all myself, and failed.
Reply
#7

.... its really easy lol
Reply
#8

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?? =)
Reply
#9

there i edited
Reply
#10

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:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)