automatic Gates for Cops
#1

Hi,

I have searched for my problem, but i have found nothing what me help.

To my problem:
I have make gates at the LSPD. This are automatic gates. The gates will open only if the player is a Cop. I have in my script gTeam.
Can someone please help me?

Here the code for the 2 Gates:
Код:
public CheckGate()
{
new lspdgate1_status;
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(IsPlayerInRangeOfPoint(i,10.0,1549.62109375, -1628.046875, 16.296792984009))lspdgate1_status=1;
    }
    if(lspdgate1_status)MoveObject(lspdgate1,1549.9049072266, -1618.0844726563, 16.296792984009,2);
    else MoveObject(lspdgate1,1549.62109375, -1628.046875, 16.296792984009,2);
    
    new lspdgate2_status;
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(IsPlayerInRangeOfPoint(i,10.0,1589.341796875, -1637.9111328125, 14.639354705811))lspdgate2_status=1;
    }
    if(lspdgate2_status)MoveObject(lspdgate2,1589.341796875, -1637.9111328125, 10.01442527771,2);
    else MoveObject(lspdgate2,1589.341796875, -1637.9111328125, 14.639354705811,2);
}
PS: I have use this tutorial: https://sampwiki.blast.hk/wiki/Automatic_Gates

Sorry for my bad english

MfG
Reply
#2

pawn Код:
if(gTeam[i] != team_id) continue;
under (unter, da du ja anscheind Deutscher bist =D)

pawn Код:
if(!IsPlayerConnected(i)) continue;
Reply
#3

There comes 4 Errors.

Код:
C:\Users\Administrator\Desktop\samp03 svr\gamemodes\lsms_rl.pwn(1516) : error 028: invalid subscript (not an array or too many subscripts): "gTeam"
C:\Users\Administrator\Desktop\samp03 svr\gamemodes\lsms_rl.pwn(1516) : error 017: undefined symbol "playerid"
C:\Users\Administrator\Desktop\samp03 svr\gamemodes\lsms_rl.pwn(1516) : error 029: invalid expression, assumed zero
C:\Users\Administrator\Desktop\samp03 svr\gamemodes\lsms_rl.pwn(1516) : fatal error 107: too many error messages on one line
@DjBluefader Ja ich bin deutscher ^^

MfG
Reply
#4

Okay,

let's try this...
pawn Код:
if(gTeam[i] != team_id) continue;
@mofa-killer
Guck wegen den anderen Errors mal im Script nach und verдndere des, so das es passt.
Reply
#5

Ich vesteh nicht was du damit meinst (I can't understand this):
Quote:
Originally Posted by DJBluefader
Guck wegen den anderen Errors mal im Script nach und verдndere des, so das es passt.
Errors:
Код:
C:\Users\Administrator\Desktop\samp03 svr\gamemodes\lsms_rl.pwn(1516) : error 028: invalid subscript (not an array or too many subscripts): "gTeam"
C:\Users\Administrator\Desktop\samp03 svr\gamemodes\lsms_rl.pwn(1516) : warning 215: expression has no effect
C:\Users\Administrator\Desktop\samp03 svr\gamemodes\lsms_rl.pwn(1516) : error 001: expected token: ";", but found "]"
C:\Users\Administrator\Desktop\samp03 svr\gamemodes\lsms_rl.pwn(1516) : error 029: invalid expression, assumed zero
C:\Users\Administrator\Desktop\samp03 svr\gamemodes\lsms_rl.pwn(1516) : fatal error 107: too many error messages on one line
This is the line 1516:
Код:
new lspdgate1_status;
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(gTeam[i] != LSPolizei) continue;   //Line 1516
        if(IsPlayerInRangeOfPoint(i,10.0,1549.62109375, -1628.046875, 16.296792984009))lspdgate1_status=1;
    }
    if(lspdgate1_status)MoveObject(lspdgate1,1549.9049072266, -1618.0844726563, 16.296792984009,2);
    else MoveObject(lspdgate1,1549.62109375, -1628.046875, 16.296792984009,2);
Reply
#6

Код:
if(gTeam[i] != team_id) continue;
Reply
#7

@mofa-killer
Du sollst die Teamid, nicht den Teamnamen einsetzen.
Reply
#8

Immer noch Errors.
Die selben wie vorher auch.

pawn Код:
#define Zivilisten 1
#define LSPolizei 2
#define SFPolizei 3
Teamid = 2? For the LSPolizei
Reply
#9

Sorry for doublepost, but i need this help so fast as possible.

Reply
#10

Код:
public CheckGate()
{
new lspdgate1_status;
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(IsPlayerInRangeOfPoint(i,10.0,1549.62109375, -1628.046875, 16.296792984009) && IsCop[i] == 1)lspdgate1_status=1;
    }
    if(lspdgate1_status)MoveObject(lspdgate1,1549.9049072266, -1618.0844726563, 16.296792984009,2);
    else MoveObject(lspdgate1,1549.62109375, -1628.046875, 16.296792984009,2);

    new lspdgate2_status;
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(IsPlayerInRangeOfPoint(i,10.0,1589.341796875, -1637.9111328125, 14.639354705811)&& IsCop[i] == 1)lspdgate2_status=1;
    }
    if(lspdgate2_status)MoveObject(lspdgate2,1589.341796875, -1637.9111328125, 10.01442527771,2);
    else MoveObject(lspdgate2,1589.341796875, -1637.9111328125, 14.639354705811,2);
}
Use your coding skillz and youll get it working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)