SA-MP Forums Archive
Gate adding problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Gate adding problem (/showthread.php?tid=387310)



Gate adding problem - Pokiri_Boii - 24.10.2012

Hey Guys.. !!

I need to make a gate and added the following commands.. !

pawn Код:
#include <a_samp>
new gate1;
new gate2;
new gate3;
new gate4;
new gate5;
Under

pawn Код:
public OnFilterScriptInit()
{
Added this

pawn Код:
gate1 = CreateObject(975, -2531.17, 3195.20, 2.17,   0.00, 0.00, 0.51);
    gate2 = CreateObject(975, -2552.60, 3194.95, 2.06,   0.00, 0.00, 0.51);
    gate3 = CreateObject(975, -2541.06, 3195.32, 2.06,   0.00, 0.00, 0.51);
    gate4 = CreateObject(975, -2532.44, 3195.32, 2.17,   0.00, 0.00, 0.51);
    gate5 = CreateObject(975, -2549.66, 3195.20, 2.06,   0.00, 0.00, 0.51);
    return 1;
}
Then i added the commands

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/openag", true)){
        if(IsPlayerInRangeOfPoint(playerid, -2534.4148,3141.7007,1.2366,357.2968))
        {
            MoveObject(gate1,-2552.60, 3194.95, -1.13,   0.00, 0.00, 0.51);
            MoveObject(gate2,-2531.17, 3195.20, -1.20,   0.00, 0.00, 0.51);
            MoveObject(gate3,-2541.06, 3195.32, -1.43,   0.00, 0.00, 0.51);
            MoveObject(gate4,-2532.44, 3195.32, -1.20,   0.00, 0.00, 0.51);
            MoveObject(gate5,-2549.66, 3195.20, -1.21,   0.00, 0.00, 0.51);
            return 1;
        }
    }
    else if(strcmp(cmdtext, "/closeag", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15.0, 0, 0, 0)){
            MoveObject(gate1, 975, -2531.17, 3195.20, 2.17,   0.00, 0.00, 0.51);
            MoveObject(gate2,975, -2552.60, 3194.95, 2.06,   0.00, 0.00, 0.51);
            MoveObject(gate3,975, -2541.06, 3195.32, 2.06,   0.00, 0.00, 0.51);
            MoveObject(gate4,975, -2532.44, 3195.32, 2.17,   0.00, 0.00, 0.51);
            MoveObject(gate5,975, -2549.66, 3195.20, 2.06,   0.00, 0.00, 0.51);
            return 1;
        }
    }
    return 0;
}
But Still i cant see the gate or the commands.. !!


Re: Gate adding problem - verlaj - 24.10.2012

Try using ZCMD, it will work perfectly and have you
Quote:

#define FILTERSCRIPT

?


Re: Gate adding problem - Glad2BeHere - 24.10.2012

simple error i saw right awah
Код:
if(IsPlayerInRangeOfPoint(playerid, -2534.4148,3141.7007,1.2366,357.2968))
//read before contining
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint


open gate
PHP код:
if(IsPlayerInRangeOfPoint(playerid7.0, -2534.4148,3141.7007,1.2366,357.2968)) 
PHP код:
0,0,0 is in the middle of the map that means u must be in the middle of the map to close it

if(IsPlayerInRangeOfPoint(playerid15.0, -2534.4148,3141.7007,1.2366,357.2968)) 



Re: Gate adding problem - Pokiri_Boii - 24.10.2012

I did as yew said .. !! I got 2 warnings..

PHP код:
C:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1974) : warning 202number of arguments does not match definition
C
:\Documents and Settings\User\Desktop\SATDM\filterscripts\TheBossHouse.pwn(1985) : warning 202number of arguments does not match definition
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
2 Warnings

here is what i did ...
PHP код:
if(IsPlayerInRangeOfPoint(playerid,7.0, -2534.4148,3141.7007,1.2366,357.2968))
        { 



Re: Gate adding problem - Glad2BeHere - 24.10.2012

then you did do what i said copy and paste what i have above u have more argument lmfao
you put x,y,z and some other cordinate watch mines and watch yours u didnt do what i told u
(playerid,distance,x,y,z)


Re: Gate adding problem - Pokiri_Boii - 24.10.2012

mm..