SA-MP Forums Archive
Teams open a gate[have gate script] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Teams open a gate[have gate script] (/showthread.php?tid=128214)



Teams open a gate[have gate script] - manunited1878 - 16.02.2010

i need that just teams can open the gate like just police can open it, i have the gate script:
Код:
#include <a_samp>

new Openlagate;

public OnFilterScriptInit()
{
Openlagate = CreateObject(980, 1762.1135253906, -1693.2562255859, 15.201999664307, 0, 0, 266.70568847656);
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/opencpg", cmdtext, true, 10) == 0)

{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1762.1135253906, -1693.2562255859, 15.201999664307))
{
MoveObject(Openlagate, 1761.650390625, -1700.6632080078, 15.200605392456, 4);
SendClientMessage(playerid, 0xFFFFFF, "You've opened the crime place gate");
}
return 1;
}
if (strcmp("/closecpg", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1762.1135253906, -1693.2562255859, 15.201999664307))
{
MoveObject(Openlagate, 1762.1135253906, -1693.2562255859, 15.201999664307, 4);
SendClientMessage(playerid, 0xFFFFFF, "You've closed the crime place gate");
}
return 1;
}
return 0;
}



Re: Teams open a gate[have gate script] - manunited1878 - 16.02.2010

Can any help me?


Re: Teams open a gate[have gate script] - VonLeeuwen - 16.02.2010

Do you use gTeams? If yes, add this:

pawn Код:
if(gTeam[playerid] == TEAM_COP)



Re: Teams open a gate[have gate script] - manunited1878 - 16.02.2010

What is GTEAMS?


Re: Teams open a gate[have gate script] - Joe Staff - 16.02.2010

Quote:
Originally Posted by manunited1878
What is GTEAMS?
Ye olde method of differentiating teams. It was to fix the GetPlayerTeam thing back in 0.2 or 0.1 (don't remember), but GetPlayerTeam works now.


Re: Teams open a gate[have gate script] - manunited1878 - 17.02.2010

Can somebody fix my script to that just a mafia can open it(you can choose self wich mafia) make it done and upload it here


Re: Teams open a gate[have gate script] - VonLeeuwen - 17.02.2010

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/opencpg", cmdtext, true, 10) == 0)
    {
        if(GetPlayerTeam(playerid) == TEAM_MAFIA) // change the 'TEAM_MAFIA' to how you defined it.
        {
            if(IsPlayerInRangeOfPoint(playerid, 10.0, 1762.1135253906, -1693.2562255859, 15.201999664307))
            {
                MoveObject(Openlagate, 1761.650390625, -1700.6632080078, 15.200605392456, 4);
                SendClientMessage(playerid, 0xFFFFFF, "You've opened the crime place gate");
            }  
        }
        return 1;
    }
    if (strcmp("/closecpg", cmdtext, true, 10) == 0)
    {
        if(GetPlayerTeam(playerid) == TEAM_MAFIA) // again, change it!
        {
            if(IsPlayerInRangeOfPoint(playerid, 10.0, 1762.1135253906, -1693.2562255859, 15.201999664307))
            {
                MoveObject(Openlagate, 1762.1135253906, -1693.2562255859, 15.201999664307, 4);
                SendClientMessage(playerid, 0xFFFFFF, "You've closed the crime place gate");
            }
        }
        return 1;
    }
    return 0;
}



Re: Teams open a gate[have gate script] - manunited1878 - 17.02.2010

Quote:
Originally Posted by VonLeeuwen
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/opencpg", cmdtext, true, 10) == 0)
    {
        if(GetPlayerTeam(playerid) == TEAM_MAFIA) // change the 'TEAM_MAFIA' to how you defined it.
        {
            if(IsPlayerInRangeOfPoint(playerid, 10.0, 1762.1135253906, -1693.2562255859, 15.201999664307))
            {
                MoveObject(Openlagate, 1761.650390625, -1700.6632080078, 15.200605392456, 4);
                SendClientMessage(playerid, 0xFFFFFF, "You've opened the crime place gate");
            }  
        }
        return 1;
    }
    if (strcmp("/closecpg", cmdtext, true, 10) == 0)
    {
        if(GetPlayerTeam(playerid) == TEAM_MAFIA) // again, change it!
        {
            if(IsPlayerInRangeOfPoint(playerid, 10.0, 1762.1135253906, -1693.2562255859, 15.201999664307))
            {
                MoveObject(Openlagate, 1762.1135253906, -1693.2562255859, 15.201999664307, 4);
                SendClientMessage(playerid, 0xFFFFFF, "You've closed the crime place gate");
            }
        }
        return 1;
    }
    return 0;
}
Now i got 11 errors:
Код:
Gateteam.pwn(1) : warning 235: public function lacks forward declaration (symbol "OnPlayerCommandText")
Gateteam.pwn(3) : error 017: undefined symbol "strcmp"
Gateteam.pwn(5) : error 017: undefined symbol "GetPlayerTeam"
Gateteam.pwn(7) : error 017: undefined symbol "IsPlayerInRangeOfPoint"
Gateteam.pwn(9) : error 017: undefined symbol "MoveObject"
Gateteam.pwn(10) : error 017: undefined symbol "SendClientMessage"
Gateteam.pwn(15) : error 017: undefined symbol "strcmp"
Gateteam.pwn(17) : error 017: undefined symbol "GetPlayerTeam"
Gateteam.pwn(19) : error 017: undefined symbol "IsPlayerInRangeOfPoint"
\Gateteam.pwn(21) : error 017: undefined symbol "MoveObject"
Gateteam.pwn(22) : error 017: undefined symbol "SendClientMessage"
Gateteam.pwn(28) : error 030: compound statement not closed at the end of file (started at line 3)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


11 Errors.



Re: Teams open a gate[have gate script] - VonLeeuwen - 17.02.2010

You have 'public OnPlayerCommandText(playerid,cmdtext[])' twice in the script, delete the one you just created, and add this at the other one:

pawn Код:
if (strcmp("/opencpg", cmdtext, true, 10) == 0)
{
if(GetPlayerTeam(playerid) == TEAM_MAFIA) // change the 'TEAM_MAFIA' to how you defined it.
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1762.1135253906, -1693.2562255859, 15.201999664307))
{
MoveObject(Openlagate, 1761.650390625, -1700.6632080078, 15.200605392456, 4);
SendClientMessage(playerid, 0xFFFFFF, "You've opened the crime place gate");
}  
}
return 1;
}
if (strcmp("/closecpg", cmdtext, true, 10) == 0)
{
if(GetPlayerTeam(playerid) == TEAM_MAFIA) // again, change it!
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1762.1135253906, -1693.2562255859, 15.201999664307))
{
MoveObject(Openlagate, 1762.1135253906, -1693.2562255859, 15.201999664307, 4);
SendClientMessage(playerid, 0xFFFFFF, "You've closed the crime place gate");
}
}
return 1;
}



Re: Teams open a gate[have gate script] - Rzzr - 17.02.2010

Errr... You have to put that in your script, you just put it in an empty file?


Re: Teams open a gate[have gate script] - manunited1878 - 17.02.2010

yes, but can i make it to an filterscript?


Re: Teams open a gate[have gate script] - VonLeeuwen - 17.02.2010

Yes you can, I'll try to make something soon, one second.

Take a look at this: http://pawn.pastebin.com/m6d9bafd

Just copy and paste it into Pawn, and save it as filterscript.


Re: Teams open a gate[have gate script] - manunited1878 - 17.02.2010

Quote:
Originally Posted by VonLeeuwen
Yes you can, I'll try to make something soon, one second.

Take a look at this: http://pawn.pastebin.com/m6d9bafd

Just copy and paste it into Pawn, and save it as filterscript.
Код:
\test.pwn(40) : error 017: undefined symbol "TEAM_COP"
\test.pwn(47) : warning 217: loose indentation
\test.pwn(50) : error 010: invalid function or declaration
\test.pwn(52) : error 010: invalid function or declaration
\test.pwn(54) : error 010: invalid function or declaration
\test.pwn(60) : error 010: invalid function or declaration
\test.pwn(62) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.