Above MoveDynamicOnject
#1

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

don't think you cat define numbers like that with #define, I may be wrong though.
Reply
#3

Quote:
Originally Posted by TheInnocentOne
don't think you cat define numbers like that with #define, I may be wrong though.
You can

But i guess it's better to define at the top of the script but nvm.

Dude, I've corrected it somewhat, but I still have some question (see comments):

Код:
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) // shouldn't time be teams?
	{
	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) //same here
	{
	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) //same here?
	{
	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) // and same here?
	{
	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;
}
Reply
#4

I put the changed code for you but have not had success after opening the gate nothing worked.
The problem is not the way I organize, I care, but thank you for the intention to help me.
What about the times I prefer to use so I see no difference to use SetTeam and GetTeam.


Note: I speak Portuguese and translate by ****** translator, so excuse the bad English.
Reply
#5

I solved using Double_O_Streamer and without #defines.
I have tryed without #defines using YSI but no succes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)