16.09.2013, 00:24
Okay guys, I really need some scripting help right now ! I am desperate.
So let me explain what the problem is.
THIS IS THE TAKING TAZER COMMAND. Which switched Deagle for sdpistol and otherwise with key "N".
THIS CODE IS WHERE THE MAGIC IS HAPPENING.
I want to recreate this code that won't use this meele taze but when I shoot a player with sdpistol he will get tazed.
I have no idea how to recreate it. Please help!
So let me explain what the problem is.
THIS IS THE TAKING TAZER COMMAND. Which switched Deagle for sdpistol and otherwise with key "N".
Код:
if(newkeys & KEY_NO && IsPlayerENF(playerid) && !IsPlayerInAnyVehicle(playerid) && PlayerTemp[playerid][isevent] == 0) { if(GetPVarInt(playerid, "Tazer") == 1) { GivePlayerWeapon(playerid, 24, 75); GetPVarInt(playerid, "Tazer"); SetPVarInt(playerid, "Tazer", 0); Action(playerid, "puts his tazer back into his belt."); return 1; } SetPVarInt(playerid, "Tazer", 1); GivePlayerWeapon(playerid, 23, 17); Action(playerid, "takes his tazer out of his belt."); return 1; }
I want to recreate this code that won't use this meele taze but when I shoot a player with sdpistol he will get tazed.
I have no idea how to recreate it. Please help!
Код:
if(!IsPlayerInAnyVehicle(playerid) && GetPVarInt(playerid, "Tazer") == 1 && IsPlayerENF(playerid) && !RecentlyShot[playerid] || !IsPlayerInAnyVehicle(playerid) && GetPlayerWeapon(playerid) == 23 && PlayerInfo[playerid][power] >= 11) { RecentlyShot[playerid] = 1; SetTimerEx("AntiSpam", 1000, false, "d", playerid); new Float:fp[4]; PlayerLoop(q) { if(q == playerid) continue; GetPlayerPos(q, fp[0], fp[1], fp[2]); if(IsPlayerAimingAt(playerid, fp[0], fp[1], fp[2], 0.9) && GetDistanceBetweenPlayers(playerid, q) < 5 && tazed[q] == 0 && !IsPlayerInAnyVehicle(q)) { ApplyAnimation(playerid,"KNIFE","knife_3",4.1,0,1,1,0,0,1); new tazemsg[ 128 ], wat[MAX_PLAYER_NAME]; if(PlayerTemp[q][hname]==1) myStrcpy(wat,"Stranger"); else myStrcpy(wat,RPName(q)); if(PlayerInfo[playerid][playerteam]==COPS) format(tazemsg,sizeof(tazemsg),"%s has been tazed by %s",wat,RPName(playerid)); else if(PlayerInfo[playerid][playerteam]==BOF) format(tazemsg,sizeof(tazemsg),"%s has been tazed by %s",wat,RPName(playerid)); else format(tazemsg,sizeof(tazemsg),"%s has been tazed by %s",wat,RPName(playerid)); NearMessage(playerid,tazemsg,COLOR_ME); tazed[ q ] = 1; TogglePlayerControllable(q,false); SetTimerEx("UnTaze",20000,0,"i",q); SetPlayerDrunkLevel(q, GetPlayerDrunkLevel(playerid)+4300); ApplyAnimation(q,"CRACK", "crckdeth2", 4.1, 0, 0, 0, 1, 1); // irl crack! new string[ 128 ]; format(string, sizeof(string), "6{TAZE} %s[%d] has been tazed by %s[%d]",PlayerName(q),q, PlayerName(playerid), playerid); iEcho(string); return 1; } } } return 1;