Ich habe einen anderen:
Wenn man das Mausrad drückt, bekommt man nen Tazer in die Hand, wenn man einen damit schlägt, tazert man ihn.
new tused[MAX_PLAYERS];
new HaveTaser[MAX_PLAYERS];
if(newkeys & KEY_LOOK_BEHIND)
{
if(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pLeader] == 19 || PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 7)
{
if(HaveTaser[playerid] == 0)
{
SetPlayerAttachedObject(playerid, 0, 18642, 6, 0.06, 0.01, 0.08, 180.0, 0.0, 0.0);
HaveTaser[playerid] = 1;
GivePlayerWeapon(playerid, 0, 1);
}
else if(HaveTaser[playerid] == 1)
{
RemovePlayerAttachedObject(playerid, 0);
HaveTaser[playerid] = 0;
}
}
}
if(newkeys & KEY_FIRE)
{
if(HaveTaser[playerid] == 1)
{
if(tused[playerid]==0)
{
ApplyAnimation(playerid,"KNIFE","knife_3",4.1,0,1,1,0,0,1);
SetTimerEx("TimerClear",2000,false,"d",playerid);
new victimid = GetClosestPlayer(playerid);
if(IsPlayerConnected(victimid))
{
if(GetDistanceBetweenPlayers(playerid,victimid) < 2)
{
new Float:health;
new name[MAX_PLAYER_NAME],cname[MAX_PLAYER_NAME],string[286];
GetPlayerName(victimid,name,sizeof(name));
GetPlayerName(playerid,cname,sizeof(cname));
GetPlayerHealth(victimid, health);
SetPlayerHealth(victimid, health - 5.0);
PlayerCuffed[victimid] = 1;
TogglePlayerControllable(victimid,0);
RemovePlayerAttachedObject(playerid, 0);
tused[playerid]=1;
HaveTaser[playerid] = 0;
ApplyAnimation(victimid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
format(string, sizeof(string), "** %s Tazert %s **",cname,name);
ProxDetector(15.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(victimid,"~b~Getazert!",5000,3);
SetTimerEx("untazer",20000 ,0,"victimid",victimid);
SetTimerEx("tablauf",20000 ,0,"victimid",playerid);
return 1;
}
}
}
}
}
forward TazerBereitForPlayer(playerid);
public TazerBereitForPlayer(playerid)
{
TazerBereit[playerid] = 1;
return 1;
}
forward untazer(playerid);
public untazer(playerid)
{
new veh=GetPlayerVehicleID(playerid);
new status=GetPlayerState(playerid);
TogglePlayerControllable(playerid,1);
ClearAnimations(playerid);
PlayerCuffed[playerid] = 0;
PutPlayerInVehicle(playerid,veh,status);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"** Du kannst dich langsam wieder bewegen...");
}
forward tablauf(playerid);
public tablauf(playerid)
{
tused[playerid]=0;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"** Du kannst deinen Tazer nun wieder benutzen!");
}
/*Hoffe habe den ganzen Coden erwischt*/
MfG.
Me