if(newkeys == KEY_ACTION) { if(gteam[playerid] == Team_LSPD) { MoveObject(PDA,1540.2041015625, -1627.822265625, 6.6545753479004,6); SendClientMessage(playerid,0x2641FEAA,"You have opened the Police Department Main gatee."); return 1; } }
MoveObject(PDA,1540.2049560547,-1627.8229980469,14.9045753479,6); SendClientMessage(playerid,0x2641FEAA,"You have Closed the Police Department Main gate.");
Originally Posted by mansonh
There are a ton of gates tutorials, do a search
or check out https://sampwiki.blast.hk/wiki/Category:Tutorials |
new GateOpen;
if(newkeys == KEY_ACTION)
{
if(gteam[playerid] == Team_LSPD) && if(GateOpen == 0)
{
MoveObject(PDA,1540.2041015625, -1627.822265625, 6.6545753479004,6);
SendClientMessage(playerid,0x2641FEAA,"You have opened the Police Department Main gate.");
}
else if(GateOpen == 1) && if(gteam[playerid] == Team_LSPD)
{
MoveObject(PDA,1540.2049560547,-1627.8229980469,14.9045753479,6);
SendClientMessage(playerid,0x2641FEAA,"You have Closed the Police Department Main gate.");
return 1;
}
Originally Posted by www.******.com
Add a
pawn Код:
Not tested. pawn Код:
|
new GateOpen; // on top
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys == KEY_ACTION) { if(gTeam[playerid] == Team_LSPD && GateOpen == 0) { MoveObject(PDA,1540.2041015625, -1627.822265625, 6.6545753479004,6); SendClientMessage(playerid,0x2641FEAA,"You have opened the Police Department Main gate."); GateOpen = 1; } else if(GateOpen == 1 && gTeam[playerid] == Team_LSPD) { MoveObject(PDA,1540.2049560547,-1627.8229980469,14.9045753479,6); SendClientMessage(playerid,0x2641FEAA,"You have Closed the Police Department Main gate."); GateOpen = 0; } } return 1; }
Originally Posted by VonLeeuwen
Код:
new GateOpen; // on top Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys == KEY_ACTION) { if(gTeam[playerid] == Team_LSPD && GateOpen == 0) { MoveObject(PDA,1540.2041015625, -1627.822265625, 6.6545753479004,6); SendClientMessage(playerid,0x2641FEAA,"You have opened the Police Department Main gate."); GateOpen = 1; } else if(GateOpen == 1 && gTeam[playerid] == Team_LSPD) { MoveObject(PDA,1540.2049560547,-1627.8229980469,14.9045753479,6); SendClientMessage(playerid,0x2641FEAA,"You have Closed the Police Department Main gate."); GateOpen = 0; } } return 1; } |
C:\Users\Natalie\Desktop\Radical RP\Radical RP Server\samp03asvr_R4_win32\gamemodes\Test1.pwn(14213) : error 017: undefined symbol "gTeam" C:\Users\Natalie\Desktop\Radical RP\Radical RP Server\samp03asvr_R4_win32\gamemodes\Test1.pwn(14213) : warning 215: expression has no effect C:\Users\Natalie\Desktop\Radical RP\Radical RP Server\samp03asvr_R4_win32\gamemodes\Test1.pwn(14213) : error 001: expected token: ";", but found "]" C:\Users\Natalie\Desktop\Radical RP\Radical RP Server\samp03asvr_R4_win32\gamemodes\Test1.pwn(14213) : error 029: invalid expression, assumed zero C:\Users\Natalie\Desktop\Radical RP\Radical RP Server\samp03asvr_R4_win32\gamemodes\Test1.pwn(14213) : fatal error 107: too many error messages on one line
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys == KEY_ACTION) { if(gteam[playerid] == Team_LSPD && GateOpen == 0) { MoveObject(PDA,1540.2041015625, -1627.822265625, 6.6545753479004,6); SendClientMessage(playerid,0x2641FEAA,"You have opened the Police Department Main gate."); GateOpen = 1; } else if(GateOpen == 1 && gteam[playerid] == Team_LSPD) { MoveObject(PDA,1540.2049560547,-1627.8229980469,14.9045753479,6); SendClientMessage(playerid,0x2641FEAA,"You have Closed the Police Department Main gate."); GateOpen = 0; } } return 1; }