13.07.2011, 00:52
Hello, i got a problem with my /doorcode cmd. When i am near, and i write /doorcode a1069, It says No such command ( Its supposed to say that when im not near anything). But i am near the object. and then its suposed to say Incorrect password.
This is my code:
Yea i know, the most part is in spanish, But the one i have the problem with is on english.
Anyone know the problem why the gate wont open?
Regards, Alex
This is my code:
pawn Код:
if(strcmp(cmd, "/doorcode", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(EstaEnUnaPuertaDeAcceso(playerid))
{
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr))
{
SendClientMessage(playerid, GRIS, "Usage: /doorcode [password]");
return 1;
}
if(JugadorEnArea(1,playerid,1411.9753,-1720.5006,6.8594))
{
if(strcmp(x_nr,"666",true) == 0)
{
format(string, sizeof(string), "%s types the door code in.", NombreJugador(playerid));
MandarMensajeCercano(30.0, playerid, string, ROSA,ROSA,ROSA,ROSA,ROSA);
MoveDynamicObject(RejaMoto,1411.13134766,-1721.04333496,-12.63276672, 40);
SetTimer("CerrarRejaMoto", 4000, 0);
}
else
{
SendClientMessage(playerid, ROJO_OSCURO, "Incorrect password");
return 1;
}
}
if(JugadorEnArea(1,playerid,1409.81,-1720.49,6.86))
{
if(strcmp(x_nr,"666",true) == 0)
{
format(string, sizeof(string), "%s types the door code in.", NombreJugador(playerid));
MandarMensajeCercano(30.0, playerid, string, ROSA,ROSA,ROSA,ROSA,ROSA);
MoveDynamicObject(RejaMoto,1411.13134766,-1721.04333496,-12.63276672, 40);
SetTimer("CerrarRejaMoto", 4000, 0);
}
else
{
SendClientMessage(playerid, ROJO_OSCURO, "Incorrect password");
return 1;
}
}
if(JugadorEnArea(1,playerid,2721.1611,-2401.1584,13.4609) || JugadorEnArea(1,playerid,2719.1311,-2409.5793,13.4609))
{
if(strcmp(x_nr,"9008",true) == 0)
{
format(string, sizeof(string), "%s types the door code in.", NombreJugador(playerid));
MandarMensajeCercano(30.0, playerid, string, ROSA,ROSA,ROSA,ROSA,ROSA);
MoveDynamicObject(RejaMilitar,2720.171875, -2414.154296875, 15.421566009521, 2);
SetTimer("CerrarReja", 12000, 0);
}
else
{
SendClientMessage(playerid, ROJO_OSCURO, "Incorrect password");
return 1;
}
}
else if(JugadorEnArea(1,playerid,2638.5093,-2359.5288,373.4041) || JugadorEnArea(1,playerid,2641.0037,-2361.2466,373.4041))
{
if(strcmp(x_nr,"9008",true) == 0)
{
format(string, sizeof(string), "%s types the door code in.", NombreJugador(playerid));
MandarMensajeCercano(30.0, playerid, string, ROSA,ROSA,ROSA,ROSA,ROSA);
MoveDynamicObject(PuertaHospital,2638.3684082031, -2360.4968261719, 373.75942993164, 2);
SetTimer("CerrarHospital", 12000, 0);
}
else
{
SendClientMessage(playerid, ROJO_OSCURO, "Incorrect password");
return 1;
}
}
else if(JugadorEnArea(1,playerid,2648.5449,-2342.5344,373.3972) || JugadorEnArea(1,playerid,2648.3965,-2340.8489,373.4041))
{
if(strcmp(x_nr,"9008",true) == 0)
{
format(string, sizeof(string), "%s types the door code in.", NombreJugador(playerid));
MandarMensajeCercano(30.0, playerid, string, ROSA,ROSA,ROSA,ROSA,ROSA);
MoveDynamicObject(PuertaOficina,2648.3293457031, -2341.4692382813, 373.75942993164, 2);
SetTimer("CerrarOficina", 12000, 0);
}
else
{
SendClientMessage(playerid, ROJO_OSCURO, "Incorrect password");
return 1;
}
}
else if(JugadorEnArea(1,playerid,2729.4312,-2450.5303,17.5937))
{
if(strcmp(x_nr,"9008",true) == 0)
{
format(string, sizeof(string), "%s types the door code in.", NombreJugador(playerid));
MandarMensajeCercano(30.0, playerid, string, ROSA,ROSA,ROSA,ROSA,ROSA);
SetPlayerPos(playerid,2651.3887,-2365.9031,374.3972);
GameTextForPlayer(playerid, "~w~Base", 5000, 1);
TogglePlayerControllable(playerid,false);
SetTimerEx("Desfrizear", 3000, false, "d", playerid);
}
else
{
SendClientMessage(playerid, ROJO_OSCURO, "Incorrect password");
return 1;
}
}
else if(JugadorEnArea(1,playerid,2627.2434,-2360.0249,373.3972))
{
if(strcmp(x_nr,"9008",true) == 0)
{
format(string, sizeof(string), "%s types the door code in.", NombreJugador(playerid));
MandarMensajeCercano(30.0, playerid, string, ROSA,ROSA,ROSA,ROSA,ROSA);
SetPlayerPos(playerid,2626.0183,-2364.0083,373.4041);
}
else
{
SendClientMessage(playerid, ROJO_OSCURO, "Incorrect password");
return 1;
}
}
else if(IsPlayerInRangeOfPoint(playerid,100,659.41174316,-1227.45092773,17.76036263)) //EVOFARM
{
if(strcmp(x_nr,"a1069",true) == 0) // HERE
{
format(string, sizeof(string), "%s uses the remote to open the gate.", NombreJugador(playerid));
MandarMensajeCercano(30.0, playerid, string, ROSA,ROSA,ROSA,ROSA,ROSA);
MoveDynamicObject(gate1,659.44201660,-1227.29089355,22.12593079,3.0);
}
else
{
SendClientMessage(playerid, ROJO_OSCURO, "Incorrect password");
return 1;
}
}
else if(JugadorEnArea(1,playerid,1826.6938,-1311.3110,131.7344)) //Tejado EVOFARM
{
if(strcmp(x_nr,"a1069",true) == 0)
{
format(string, sizeof(string), "%s types the door code in.", NombreJugador(playerid));
MandarMensajeCercano(30.0, playerid, string, ROSA,ROSA,ROSA,ROSA,ROSA);
SetPlayerPos(playerid,1816.8163,-1309.3182,104.8923);
}
else
{
SendClientMessage(playerid, ROJO_OSCURO, "Incorrect password");
return 1;
}
}
}
else
{
SendClientMessage(playerid, ROJO_OSCURO, " No such command");
return 1;
}
}
return 1;
}
else
{
SendClientMessage(playerid, ROJO, "[TWD-RP]: Command does not exist, try again.");
}
return 1;
}
Anyone know the problem why the gate wont open?
Regards, Alex