Miren, use crashdetect y me saliу esto, pero reviso y no veo error en el public
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new string[128];
//new giveplayerid;
if(newkeys == KEY_FIRE)
{
if(Tazer[playerid] > 0)
{
if(IsPlayerInAnyVehicle(playerid)) return Message(playerid, COLOR_GREY, "Este comando no se puede utilizar estando en un vehнculo.");
new suspect = GetClosestPlayer(playerid);
if(PlayerTazeado[suspect] > 0) return Message(playerid, COLOR_GREY, "ЎEste jugador ya estб tazeado!");
if(ProxDetectorS(3.0, playerid,suspect))
{
if(IsACop(suspect)) return Message(playerid, COLOR_GREY, "ЎNo puedes tazear a un compaсero!");
new randt = random(4)+1;
if(randt == 1)
{
format(string, sizeof(string), "* Oficial %s dispara contra %s, pero no consigue tazear al sujeto", PlayerName(playerid), PlayerName(suspect));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
Tazer[playerid] = 0;
SetTimerEx("RemoveStun", 7000, false, "i", playerid);
}
else
{
format(string, sizeof(string), "* Oficial %s dispara contra %s y tazea al sujeto", PlayerName(playerid), PlayerName(suspect));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string, sizeof(string), "* Tazeado (%s)", PlayerName(suspect));
ProxDetector(30.0,playerid, string, 0xB6DB22FF,0xB6DB22FF,0xB6DB22FF,0xB6DB22FF,0xB6DB22FF);
GameTextForPlayer(suspect, "ARRESTADO", 2500, 3);
TogglePlayerControllable(suspect, 0);
ApplyAnimation(suspect, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
PlayerTazeado[suspect] = 1;
Tazer[playerid] = 0;
SetTimerEx("RemoveStun", 7000, false, "i", playerid);
SetTimerEx("UntazePlayer", 20000, false, "i", suspect);
}
}
else Message(playerid, COLOR_GRAD2, "Jugador muy lejos.");
}
}
if(newkeys & KEY_WALK)
{
if(Skate[playerid] > 9)
{
ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
}
}
if(newkeys & KEY_SPRINT)
{
if(IsPlayerConnected(playerid))
{
if(PlayerDrunk[playerid] > 9) { ApplyAnimation(playerid,"PED", "WALK_DRUNK",6.0,0,1,0,0,PlayerDrunk[playerid]*1000); }
else if(Skate[playerid] > 9)
{
if(Skate[playerid] == 10) ApplyAnimation(playerid,"SKATE","skate_idle",4.0,1,1,1,1,500);
else if(Skate[playerid] == 20) ApplyAnimation(playerid,"SKATE","skate_run",4.0,1,1,1,1,500);
else if(Skate[playerid] == 30) ApplyAnimation(playerid,"SKATE","skate_sprint",4.0,1,1,1,1,500);
}
else if(PlayerCuffed[playerid] > 0 || Rescued[playerid] > 0) ApplyAnimation(playerid,"PED","WALK_civi",4.1,1,1,1,1,1);
else if(PuedeP[playerid] == 1) GameTextForPlayer(playerid, "~r~Espere", 3000, 3);
else if(TutTime[playerid] > 0)
{
if(TutTime[playerid] == 15) TutTime[playerid] = 25;
else if(TutTime[playerid] == 25) TutTime[playerid] = 35;
else if(TutTime[playerid] == 35) TutTime[playerid] = 50;
else if(TutTime[playerid] == 50) TutTime[playerid] = 65;
else if(TutTime[playerid] == 65) TutTime[playerid] = 70;
TutorialStep_Forward(playerid);
}
else if(Accesory[playerid] > 0)
{
if(Accesory[playerid] == 1) // Glasses
{
switch(ClothesID[playerid])
{
case 19005: { Accesory_Test(playerid, 3, 19006, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19006: { Accesory_Test(playerid, 3, 19007, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19007: { Accesory_Test(playerid, 3, 19008, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19008: { Accesory_Test(playerid, 3, 19009, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19009: { Accesory_Test(playerid, 3, 19010, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19010: { Accesory_Test(playerid, 3, 19011, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19011: { Accesory_Test(playerid, 3, 19012, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19012: { Accesory_Test(playerid, 3, 19013, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19013: { Accesory_Test(playerid, 3, 19014, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19014: { Accesory_Test(playerid, 3, 19015, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19015: { Accesory_Test(playerid, 3, 19016, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19016: { Accesory_Test(playerid, 3, 19017, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19017: { Accesory_Test(playerid, 3, 19018, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19018: { Accesory_Test(playerid, 3, 19019, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19019: { Accesory_Test(playerid, 3, 19020, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19020: { Accesory_Test(playerid, 3, 19021, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19021: { Accesory_Test(playerid, 3, 19022, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19022: { Accesory_Test(playerid, 3, 19023, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19023: { Accesory_Test(playerid, 3, 19024, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19024: { Accesory_Test(playerid, 3, 19025, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19025: { Accesory_Test(playerid, 3, 19026, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19026: { Accesory_Test(playerid, 3, 19027, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19027: { Accesory_Test(playerid, 3, 19028, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19028: { Accesory_Test(playerid, 3, 19029, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19029: { Accesory_Test(playerid, 3, 19030, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19030: { Accesory_Test(playerid, 3, 19031, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19031: { Accesory_Test(playerid, 3, 19032, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19032: { Accesory_Test(playerid, 3, 19033, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19033: { Accesory_Test(playerid, 3, 19034, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
case 19034: { Accesory_Test(playerid, 3, 19035, 2, 0.105227, 0.044110, -0.000622, 91.258476, 92.199562, 1.592636, 1.000000, 1.000000, 1.000000, 100); }
default: {ClothesID[playerid] = 19005; Message(playerid, COLOR_GRAD2, "Has visto todas las gafas. Apreta ESPACIO para volver a verlas"); }
}
}
else if(Accesory[playerid] == 2) // Bandana
{
switch(ClothesID[playerid])
{
case 18910: {Accesory_Bandana(playerid, 18917);}
case 18917: {Accesory_Bandana(playerid, 18913);}
case 18913: {Accesory_Bandana(playerid, 18916);}
case 18916: {Accesory_Bandana(playerid, 18915);}
case 18915: {Accesory_Bandana(playerid, 18912);}
default: {ClothesID[playerid] = 18910; Message(playerid, COLOR_GRAD2, "Has visto todas las bandanas. Apreta ESPACIO para volver a verlas"); }
}
}
else if(Accesory[playerid] == 3) // Hat
{
switch(ClothesID[playerid])
{
case 18925: { Accesory_Test(playerid, 2, 18926, 2, 0.166478, -0.010493, -0.003216, 330.359344, 2.471933, 350.632476, 1.000000, 1.000000, 1.084919, 150); }
case 18926: { Accesory_Test(playerid, 2, 18927, 2, 0.166478, -0.010493, -0.003216, 330.359344, 2.471933, 350.632476, 1.000000, 1.000000, 1.084919, 150); }
case 18927: { Accesory_Test(playerid, 2, 18928, 2, 0.166478, -0.010493, -0.003216, 330.359344, 2.471933, 350.632476, 1.000000, 1.000000, 1.084919, 150); }
case 18928: { Accesory_Test(playerid, 2, 18929, 2, 0.166478, -0.010493, -0.003216, 330.359344, 2.471933, 350.632476, 1.000000, 1.000000, 1.084919, 150); }
case 18929: { Accesory_Test(playerid, 2, 18930, 2, 0.166478, -0.010493, -0.003216, 330.359344, 2.471933, 350.632476, 1.000000, 1.000000, 1.084919, 150); }
case 18930: { Accesory_Test(playerid, 2, 18931, 2, 0.166478, -0.010493, -0.003216, 330.359344, 2.471933, 350.632476, 1.000000, 1.000000, 1.084919, 150); }
case 18931: { Accesory_Test(playerid, 2, 18932, 2, 0.166478, -0.010493, -0.003216, 330.359344, 2.471933, 350.632476, 1.000000, 1.000000, 1.084919, 150); }
case 18932: { Accesory_Test(playerid, 2, 18933, 2, 0.166478, -0.010493, -0.003216, 330.359344, 2.471933, 350.632476, 1.000000, 1.000000, 1.084919, 150); }
case 18933: { Accesory_Test(playerid, 2, 18934, 2, 0.166478, -0.010493, -0.003216, 330.359344, 2.471933, 350.632476, 1.000000, 1.000000, 1.084919, 150); }
case 18934: { Accesory_Test(playerid, 2, 18935, 2, 0.166478, -0.010493, -0.003216, 330.359344, 2.471933, 350.632476, 1.000000, 1.000000, 1.084919, 150); }
default: {ClothesID[playerid] = 18925; Message(playerid, COLOR_GRAD2, "Has visto todas las gorras. Apreta ESPACIO para volver a verlas"); }
}
}
}
}
}
if(newkeys & KEY_SECONDARY_ATTACK)
{
if(IsPlayerConnected(playerid))
{
if(RStep[playerid] > 0)
{
if(RStep[playerid] == 1)
{
new mtext[12],otext[12];
if(PlayerInfo[playerid][pSex] == 1) mtext = "Masculino"; else mtext = "Femenino";
if(PlayerInfo[playerid][pOrigin] == 1) otext = "America";
if(PlayerInfo[playerid][pOrigin] == 2) otext = "Europa";
if(PlayerInfo[playerid][pOrigin] == 3) otext = "Asia";
if(PlayerInfo[playerid][pOrigin] == 4) otext = "Africa";
if(PlayerInfo[playerid][pOrigin] == 5) otext = "Oceania";
if(RegConfig[playerid] == 1)
{
format(string, sizeof(string), "~n~Sexo: ~r~%s ~>~~w~Edad: ~r~?~n~~n~~w~Origen: ~r~Sin Origen ~w~Estilo: ~r~?", mtext);
TDStr(RegDraw[playerid], string);
PlayerInfo[playerid][pChar] = GetPlayerSkin(playerid);
RegConfig[playerid] = 2;
RegText[playerid] = 0;
ApplyAnimation(playerid,"STRIP","PUN_HOLLER",4.1,7,5,1,1,1);
return 1;
}
else if(RegConfig[playerid] == 2)
{
format(string, sizeof(string), "~n~Sexo: ~r~%s ~w~Edad: ~r~%d~n~~n~~>~~w~Origen: ~r~Sin Origen ~w~Estilo: ~r~?", mtext, PlayerInfo[playerid][pAge]);
TDStr(RegDraw[playerid], string);
RegConfig[playerid] = 3;
RegText[playerid] = 1;
PlayerInfo[playerid][pOrigin] = 1;
ApplyAnimation(playerid,"STRIP","PUN_HOLLER",4.1,7,5,1,1,1);
return 1;
}
else if(RegConfig[playerid] == 3)
{
format(string, sizeof(string), "~n~Sexo: ~r~%s ~w~Edad: ~r~%d~n~~n~~w~Origen: ~r~%s ~>~~w~Estilo: ~r~?", mtext, PlayerInfo[playerid][pAge],otext);
TDStr(RegDraw[playerid], string);
RStep[playerid] = 1;
RegText[playerid] = 1;
RegConfig[playerid] = 4;
ApplyAnimation(playerid,"STRIP","PUN_HOLLER",4.1,7,5,1,1,1);
return 1;
}
else if(RegConfig[playerid] == 4)
{
ClearChatbox(playerid, 15);
TextDrawHideForPlayer(playerid, RegDraw[playerid]);
TextDrawHideForPlayer(playerid, RegInfo);
ApplyAnimation(playerid,"PED","WALK_player",4.0,0,0,0,0,1)
RStep[playerid] = 0;
RegText[playerid] = 0;
RegConfig[playerid] = 0;
SetTimerEx("Reg_ShowDNI", 3000, false, "i", playerid);
GameTextForPlayer(playerid, "~r~Configurando ~w~DNI", 3000, 3);
SetTimerEx("RegMsn", 6000, false, "i", playerid);
}
}
}
if (GetPlayerState(playerid) == 1)
{
new key = PlayerInfo[playerid][pPhousekey];
TeleportPlayer(playerid);
if(ReduceTime[playerid] == 0)
{
new Float:hp; GetPlayerHealth(playerid, hp);
if(PlayerToPoint(1.0,playerid,-36.3182,-56.8905,1003.5469))
{
ReduceTime[playerid] = 1;
SetTimerEx("ReduceTimer", 3000, false, "i", playerid);
if(hp < 100) SetHP(playerid, hp+10);
}
else if(PlayerToPoint(1.0,playerid,-19.1974,-56.8366,1003.5469))
{
ReduceTime[playerid] = 1;
SetTimerEx("ReduceTimer", 3000, false, "i", playerid);
if(hp < 100) SetHP(playerid, hp+10);
}
else if(PlayerToPoint(1.0,playerid,-35.9060,-139.2014,1003.5469))
{
ReduceTime[playerid] = 1;
SetTimerEx("ReduceTimer", 3000, false, "i", playerid);
if(hp < 100) SetHP(playerid, hp+10);
}
else if(PlayerToPoint(1.0,playerid,-15.2743,-139.2626,1003.5469))
{
ReduceTime[playerid] = 1;
SetTimerEx("ReduceTimer", 3000, false, "i", playerid);
if(hp < 100) SetHP(playerid, hp+5);
}
else if(PlayerToPoint(1.0,playerid,-16.7039,-139.3292,1003.5469))
{
ReduceTime[playerid] = 1;
SetTimerEx("ReduceTimer", 3000, false, "i", playerid);
if(hp < 100) SetHP(playerid, hp+10);
}
}
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
{
if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0 || AdminDuty[playerid] == 1)
{
SetPosEx(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz],0,HouseInfo[i][hInt],HouseInfo[i][hWorld]);
HouseEntered[playerid] = i;
BizzEntered[playerid] = -1;
}
else GameTextForPlayer(playerid, "~r~Cerrado", 5000, 1);
}
else if (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
{
if(HouseEntered[playerid] == i)
{
SetPosEx(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez],0,0,0);
HouseEntered[playerid] = -1;
}
}
else if (PlayerToPoint(3, playerid,HouseInfo[key][hExitx], HouseInfo[key][hExity], HouseInfo[key][hExitz]))
{
SetPosEx(playerid,HouseInfo[key][hEntrancex],HouseInfo[key][hEntrancey],HouseInfo[key][hEntrancez],0,0,0);
HouseEntered[playerid] = -1;
}
}
}
else if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}
}
}
return 1;
}