Teams open a gate[have gate script]
#1

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;
}
Reply
#2

Can any help me?
Reply
#3

Do you use gTeams? If yes, add this:

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

What is GTEAMS?
Reply
#5

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

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

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;
}
Reply
#8

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

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;
}
Reply
#10

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

yes, but can i make it to an filterscript?
Reply
#12

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)