05.09.2018, 18:49
These are my scripts if anyone knows how to help me.
Code :
Code :
Code :
Quote:
CMD:tazer(playerid, params[]) { if(HungerPlayerInfo[playerid][hgInEvent] != 0) return SendClientMessageEx(playerid, COLOR_GREY, " Ban khong the lam dieu nay khi dang tham gia su kien Hunger Games!"); #if defined zombiemode if(zombieevent == 1 && GetPVarType(playerid, "pIsZombie")) return SendClientMessageEx(playerid, COLOR_GREY, "Zombies khong the su dung."); #endif if(IsACop(playerid)) { new string[128]; if(PlayerInfo[playerid][pConnectHours] < 2 || PlayerInfo[playerid][pWRestricted] > 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "Ban khong the lay sung dien, ban dang bi han che vu khi!"); if(GetPVarInt(playerid, "IsInArena") >= 0) { SendClientMessageEx(playerid, COLOR_WHITE, "Ban khong the lam dieu nay bay gio, ban dang trong arena!"); return 1; } if(GetPVarInt( playerid, "EventToken") != 0) { SendClientMessageEx(playerid, COLOR_GREY, "Ban khong the lam dieu nay khi dang tham gia su kien."); return 1; } if(PlayerCuffedTime[playerid] > 0) { SendClientMessageEx(playerid, COLOR_GREY, "Ban khong the lam dieu nay bay gio."); return 1; } if(GetPVarInt(playerid, "Injured") == 1) { SendClientMessageEx(playerid, COLOR_GREY, "Ban khong the lam dieu nay bay gio."); return 1; } if(PlayerInfo[playerid][pJailTime] > 0) { SendClientMessageEx(playerid, COLOR_WHITE, "Ban khong the lam dieu nay trong tu."); return 1; } if(PlayerCuffed[playerid] >= 1) { SendClientMessageEx(playerid, COLOR_WHITE, "Ban khong the lam dieu nay bay gio."); return 1; } if(PlayerInfo[playerid][pHasTazer] < 1) { SendClientMessage(playerid, COLOR_WHITE, "Ban khong co sung dien!"); return 1; } if(pTazer{playerid} == 0) { pTazerReplace{playerid} = PlayerInfo[playerid][pGuns][2]; if(PlayerInfo[playerid][pGuns][2] != 0) RemovePlayerWeapon(playerid, PlayerInfo[playerid][pAmmo][2]); format(string, sizeof(string), "* %s lay khau sung dien ra.", GetPlayerNameEx(playerid)); ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); GivePlayerValidWeapon(playerid, 23, 60000); pTazer{playerid} = 1; } else { RemovePlayerWeapon(playerid, 23); GivePlayerValidWeapon(playerid, pTazerReplace{playerid}, 0); format(string, sizeof(string), "* %s cat khau sung dien vao.", GetPlayerNameEx(playerid)); ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); pTazer{playerid} = 0; } } else { SendClientMessageEx(playerid, COLOR_GRAD2, " Ban khong phai la nhan vien chinh phu!"); return 1; } return 1; } |
Quote:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid) { if (damagedid == INVALID_PLAYER_ID) return 1; if (playerid == INVALID_PLAYER_ID) return 1; if(pTazer{playerid} == 1) { if(weaponid != 23) { new string[44 + MAX_PLAYER_NAME]; RemovePlayerWeapon(playerid, 23); GivePlayerValidWeapon(playerid, pTazerReplace{playerid}, 60000); format(string, sizeof(string), "* %s holsters their tazer.", GetPlayerNameEx(playerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); pTazer{playerid} = 0; return 1; } if(!ProxDetectorS(20.0, playerid, damagedid)) { new string[44 + (MAX_PLAYER_NAME * 2)]; format(string, sizeof(string), "* %s fires their tazer at %s, missing them.", GetPlayerNameEx(playerid), GetPlayerNameEx(damagedid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); return 1; } if(TazerTimeout[playerid] > 0 && !GetPVarType(damagedid, "IsFrozen")) { new Float:hp; GetPlayerHealth(damagedid, hp); SetPlayerHealth(damagedid, hp-amount); return 1; } if(GetPlayerState(damagedid) == PLAYER_STATE_ONFOOT && PlayerCuffed[damagedid] == 0 && PlayerInfo[playerid][pHasTazer] == 1) { if(PlayerInfo[damagedid][pAdmin] >= 2 && PlayerInfo[damagedid][pTogReports] != 1) { SendClientMessageEx(playerid, COLOR_GRAD2, "Admin khong the bi tazer!"); new Float:hp; GetPlayerHealth(damagedid, hp); SetPlayerHealth(damagedid, hp+amount); return 1; } #if defined zombiemode if(GetPVarInt(damagedid, "pIsZombie")) { SendClientMessageEx(playerid, COLOR_GRAD2, "Zombie khong the bi tazer!"); return 1; } #endif new Float:X, Float:Y, Float:Z, Float:hp; GetPlayerPos(playerid, X, Y, Z); GetPlayerHealth(damagedid, hp); new string[44 + (MAX_PLAYER_NAME * 2)]; format(string, sizeof(string), "* %s da ban sung dien lam te liet %s .", GetPlayerNameEx(playerid), GetPlayerNameEx(damagedid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); GameTextForPlayer(damagedid, "~r~BeanBag", 3500, 3); SetPlayerHealth(damagedid, hp+amount); TogglePlayerControllable(damagedid, 0); ApplyAnimation(damagedid,"PED","KO_skid_front",4.1 ,0,1,1,1,1,0); PlayerPlaySound(damagedid, 1085, X, Y, Z); PlayerPlaySound(playerid, 1085, X, Y, Z); PlayerCuffed[damagedid] = 1; SetPVarInt(damagedid, "PlayerCuffed", 1); PlayerCuffedTime[damagedid] = 16; SetPVarInt(damagedid, "IsFrozen", 1); TazerTimeout[playerid] = 6; SetTimerEx("TazerTimer",1000,false,"d",playerid); } } return 1; } |