13.06.2010, 19:44
The server stops working when I use the car horn to open the gate.
Do not know why, but it does not crash or closed connection, but nothing works after playing the horn.
Do not know why, but it does not crash or closed connection, but nothing works after playing the horn.
pawn Код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys){
#define DentroDaBase1 3481.4304,1322.9604,1.5750
#define DentroDaBase2 3479.0872,767.5735,1.6250
#define ForaDaBase1 3481.9680,1314.1949,1.5750
#define ForaDaBase2 3479.6289,774.8705,1.6250
#define PortaoDireitoBase1Aberto 3477.2426757813, 1317.9661865234, 1.5749971866608
#define PortaoEsquerdoBase1Aberto 3485.2077636719, 1317.8688964844, 1.5749989748001
#define PortaoDireitoBase2Aberto 3492.1472167969, 770.59075927734, 1.2499997615814
#define PortaoEsquerdoBase2Aberto 3465.4809570313, 770.98205566406, 1.324999332428
/*Objetos_Mapa[3][15] direito base 1
Objetos_Mapa[3][16] esquerdo base 1
Objetos_Mapa[3][17] esquerdo base 2
Objetos_Mapa[3][18] direito base 2*/
if(newkeys==KEY_HORN&&IsPlayerInRangeOfPoint(playerid,4.0,DentroDaBase1)){
if(GetPVarInt(playerid,"Time")==TEAM_XIITAS){
SendClientMessage(playerid,Branco,"dentro da base xiita");
MoveDynamicObject(Objetos_Mapa[3][15],PortaoDireitoBase1Aberto,2);
MoveDynamicObject(Objetos_Mapa[3][16],PortaoEsquerdoBase1Aberto,2);
}}
if(newkeys==KEY_HORN&&IsPlayerInRangeOfPoint(playerid,4.0,ForaDaBase1)){
if(GetPVarInt(playerid,"Time")==TEAM_XIITAS){
SendClientMessage(playerid,Branco,"fora da base xiita");
MoveDynamicObject(Objetos_Mapa[3][15],PortaoDireitoBase1Aberto,2);
MoveDynamicObject(Objetos_Mapa[3][16],PortaoEsquerdoBase1Aberto,2);
StopDynamicObject(Objetos_Mapa[3][15]);
StopDynamicObject(Objetos_Mapa[3][16]);
}}
if(newkeys==KEY_HORN&&IsPlayerInRangeOfPoint(playerid,4.0,DentroDaBase2)){
if(GetPVarInt(playerid,"Time")==TEAM_SUNITAS&&GetPlayerState(playerid)==PLAYER_STATE_DRIVER){
SendClientMessage(playerid,Branco,"dentro da base sunita");
MoveDynamicObject(Objetos_Mapa[3][18],PortaoDireitoBase2Aberto,2);
MoveDynamicObject(Objetos_Mapa[3][17],PortaoEsquerdoBase2Aberto,2);
}}
if(newkeys==KEY_HORN&&IsPlayerInRangeOfPoint(playerid,4.0,ForaDaBase2)){
if(GetPVarInt(playerid,"Time")==TEAM_SUNITAS){
SendClientMessage(playerid,Branco,"fora da base sunita");
MoveDynamicObject(Objetos_Mapa[3][18],PortaoDireitoBase2Aberto,2);
MoveDynamicObject(Objetos_Mapa[3][17],PortaoEsquerdoBase2Aberto,2);
StopDynamicObject(Objetos_Mapa[3][18]);
StopDynamicObject(Objetos_Mapa[3][17]);
}}
return 1;
}