02.11.2012, 18:15
Olб pessoal, o problema й o seguinte, esse FS era para quando o player fizer /tazer aparecer a SD Pistol na mгo dele, e ele atirar no player, e o player cair, ficar parlisado, e com o anim de CRACK. Mais nгo estб acontecendo isso, tudo estб normalmente, mais quando o Player atira no outro, ele nгo cai nem fica paralisado! Por favor, arrumem para mim, preciso de ajuda!
------------------------------------------------------------------------------------------------------------------
Hey guys, the problem is the following, this FS was for when the player makes /tazer appear to SD Pistol in his hand, and he throw in player, and the player fall, stay parlisado, and with the anim of CRACK. More is not happening this, everything is usually more when the Player throws in another, he does not fall nor is paralyzed! Please sort it out for me, I need help!
------------------------------------------------------------------------------------------------------------------
If necessary, use the include OPSP (OnPlayerShootPlayer)
------------------------------------------------------------------------------------------------------------------
Hey guys, the problem is the following, this FS was for when the player makes /tazer appear to SD Pistol in his hand, and he throw in player, and the player fall, stay parlisado, and with the anim of CRACK. More is not happening this, everything is usually more when the Player throws in another, he does not fall nor is paralyzed! Please sort it out for me, I need help!
------------------------------------------------------------------------------------------------------------------
Код:
#include <a_samp> #tryinclude <angdist> #if !defined IsPlayerAimingAtPlayer #error You need the 'angdist' include. You can get it at the release topic. #endif #define SECONDS 10 #define TAZE_MS 400 #define IsNotCop(%0) ((GetPlayerSkin(%0) < 280 && GetPlayerSkin(%0) > 288)) forward Unfreeze(playerid); forward OnPlayerTazePlayer(playerid); public OnFilterScriptInit() { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) SetPVarInt(i, "TazeTimer", SetTimerEx("OnPlayerTazePlayer", TAZE_MS, true, "i", i)); } return 1; } public OnPlayerConnect(playerid) { SetPVarInt(playerid, "TazeTimer", SetTimerEx("OnPlayerTazePlayer", TAZE_MS, true, "i", playerid)); return 1; } public OnPlayerDisconnect(playerid) { KillTimer(GetPVarInt(playerid, "TazeTimer")); return 1; } public OnPlayerTazePlayer(playerid) { new Keys[3]; GetPlayerKeys(playerid, Keys[0], Keys[1], Keys[2]); if(Keys[0] & KEY_FIRE) { if(IsNotCop(playerid)) return 1; else { if((GetPlayerWeapon(playerid) == 23) && (GetPVarInt(playerid, "HasTazer")) == 1) { new targetid = 0; while ((targetid < MAX_PLAYERS) && (IsPlayerConnected(targetid))) { if(GetDistanceBetweenPlayers(playerid, targetid) >= 4) { if(IsPlayerAimingAtPlayer(playerid, targetid) == 1) { if(IsPlayerInAnyVehicle(targetid) == 0 && IsPlayerInAnyVehicle(playerid) == 0) { if(targetid != playerid) { // Feel free to add some other stuff here... // Remember, variable 'targetid' is the player who got tazed! if(GetPVarInt(targetid, "Tazed") == 1) return 0; ApplyAnimation(targetid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); TogglePlayerControllable(targetid, 0); SetTimerEx("Unfreeze", (SECONDS * 1000), false, "i", targetid); SetPVarInt(targetid, "Tazed", 1); } } } } targetid ++; } } } } return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/tazer", true)) { if(IsNotCop(playerid)) return 1; if(GetPVarInt(playerid, "HasTazer") == 0) { SetPVarInt(playerid, "HasTazer", 1); GivePlayerWeapon(playerid, 23, 65500); SendClientMessage(playerid, 0xFFFF00FF, "Tazer unholstered."); } else { DeletePVar(playerid, "HasTazer"); SetPlayerAmmo(playerid, 23, 0); SendClientMessage(playerid, 0xFFFF00FF, "Tazer holstered."); } return 1; } return 0; } public Unfreeze(playerid) { TogglePlayerControllable(playerid, 1); DeletePVar(playerid, "Tazed"); return ClearAnimations(playerid); }