Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************
- *
- * Tazer
- *
- ******************/
- public Action:Command_Tazer(client, args)
- {
- if (GetClientTeam(client) == 3)
- {
- if (g_tazer[client] > 0)
- {
- new i = GetClientAimTarget(client, true);
- if (!IsValidEdict(i) || g_IsTazed[i] == true || GetClientTeam(i) == 3 || !IsPlayerAlive(i) || !IsPlayerAlive(client))
- return Plugin_Handled;
- else
- {
- if (!OnRend[i])
- {
- new Float:entorigin[3], Float:clientent[3];
- GetEntPropVector(i, Prop_Send, "m_vecOrigin", entorigin);
- GetEntPropVector(client, Prop_Send, "m_vecOrigin", clientent);
- new Float:distance = GetVectorDistance(entorigin, clientent);
- if (distance <= 500)
- {
- g_IsTazed[i] = true;
- decl String:player_name[65], String:gardien_name[65];
- GetClientName(i, player_name, sizeof(player_name));
- GetClientName(client, gardien_name, sizeof(gardien_name));
- g_Count[i] = 7.0;
- g_tazer[client]--;
- PrecacheSound("bot/aah.wav", true);
- EmitSoundToAll("bot/aah.wav", i, _, _, _, 1.0);
- PrecacheSound(SOUND_TAZER, true);
- EmitSoundToAll(SOUND_TAZER, client, _, _, _, 1.0);
- clientent[2] += 45;
- entorigin[2] += 45;
- TE_SetupBeamPoints(clientent, entorigin, g_LightingSprite, 0, 1, 0, 1.0, 20.0, 0.0, 2, 5.0, TAZER_COLORGRAY, 3);
- TE_SendToAll();
- disarm(i);
- SetEntityMoveType(i, MOVETYPE_NONE);
- CPrintToChat(client, "%s Vous avez tazé et désarmé le joueur {green}%N", Prefix, i);
- g_TazerTimer[i] = CreateTimer(0.1, DoTazer, i, TIMER_REPEAT);
- }
- else
- {
- CPrintToChat(client, "%s Vous êtes trop loin pour tazer.", Prefix);
- }
- }
- else
- {
- CPrintToChat(client, "%s Le joueur est en train de se rendre.", Prefix);
- }
- }
- }
- else
- {
- CPrintToChat(client, "%s Vous n'avez plus de tazer.", Prefix);
- }
- }
- else
- {
- CPrintToChat(client, "%s Vous n'avez pas accès à cette commande", Prefix);
- }
- return Plugin_Handled;
- }
- public Action:MettreEnBleu(Handle:timer, any:client)
- {
- if (IsClientInGame(client))
- {
- if (g_IsTazed[client] == true && IsPlayerAlive(client))
- {
- CreateTimer(5.0, client)
- SetEntityRenderColor(client, 0, 0, 255, 255);
- }
- }
- }
- public Action:DoTazer(Handle:timer, any:client)
- {
- if (IsClientInGame(client))
- {
- if (g_IsTazed[client] == true && IsPlayerAlive(client))
- {
- g_Count[client] -= 0.1;
- if (g_Count[client] >= 0.0)
- {
- new Float:entorigin[3];
- GetEntPropVector(client, Prop_Send, "m_vecOrigin", entorigin);
- for(new ii=1; ii<8; ii++)
- {
- entorigin[2]+= (ii*9);
- TE_SetupBeamRingPoint(entorigin, 45.0, 45.1, g_modelLaser, g_modelHalo, 0, 1, 0.1, 8.0, 1.0, TAZER_COLORGRAY, 1, 0);
- TE_SendToAll();
- entorigin[2]-= (ii*9);
- }
- return Plugin_Handled;
- SetEntProp(client, Prop_Data, "m_takedamage", 2, 1);
- }
- else
- {
- g_IsTazed[client] = false;
- }
- }
- else
- {
- g_IsTazed[client] = false;
- g_Count[client] = 0.0;
- if (IsPlayerAlive(client))
- {
- SetEntityMoveType(client, MOVETYPE_WALK);
- }
- KillTazer(client);
- }
- }
- else
- {
- KillTazer(client);
- }
- }
- public KillTazer(client)
- {
- if (g_TazerTimer[client] != INVALID_HANDLE)
- {
- KillTimer(g_TazerTimer[client]);
- g_TazerTimer[client] = INVALID_HANDLE;
- }
- }
- public Tazer(client)
- {
- if (GetClientTeam(client) == 3)
- {
- if (VIP(client))
- {
- g_tazer[client] = 3;
- }
- else
- {
- g_tazer[client] = 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement