Jump to content

como ponerlo para Team


Recommended Posts

Bueno este scipt es para que cuando un player le da a otro con la silence el jugador queda asiendo una animacion (una especie de tazer) lo que quiero hacer es ponerlo para que la policia aga eso nomas, porfavor si me pueden echar una ayudita se los agradeceria :D

server

local time = 3 --In seconds, time, when player is frozen 
  
function onParalyzed() 
    setPedFrozen ( source, true ) 
    setPedAnimation( source, "ped", "FLOOR_hit_f") 
     
    setTimer(setPedFrozen, time * 1000, 1, source, false) 
    setTimer(setPedAnimation, time * 1000, 1, source) 
end 
  
addEvent("onParalyze", true) 
addEventHandler("onParalyze", getRootElement(), onParalyzed) 

client

local shotmsg = false --Show message when you shot someone 
local nshomsg = false --Show message, when your deagle don't shot a player 
  
local smsg = "* You shot player " --Message, when you shot someone (text + player name) 
local nmsg = "* You didn't shot anyone" --Message, when you don't shot anyone 
  
local weaponid = 23 
local localplayer = getLocalPlayer() 
  
function onFire(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) 
    if weapon == weaponid then 
        if hitElement then 
        if getElementType(hitElement) == "player" and hitElement ~= localplayer then 
            if shotmsg then 
                outputChatBox(smsg .. getPlayerName(hitElement), 0, 255, 0) 
            end 
            triggerServerEvent("onParalyze", hitElement) 
        else 
            if nshomsg then 
                outputChatBox(nmsg, 255, 0 ,0) 
            end 
        end 
    end 
end 
end 
  
addEventHandler( "onClientPlayerWeaponFire", getRootElement(), onFire) 

Link to comment

Intenta así

server

local time = 3 --In seconds, time, when player is frozen 
  
function onParalyzed() 
local team = getPlayerTeam() 
    if (team and getTeamName(team) == "Policia") then 
    setPedFrozen ( source, true ) 
    setPedAnimation( source, "ped", "FLOOR_hit_f") 
    
    setTimer(setPedFrozen, time * 1000, 1, source, false) 
    setTimer(setPedAnimation, time * 1000, 1, source) 
end 
end 
  
addEvent("onParalyze", true) 
addEventHandler("onParalyze", getRootElement(), onParalyzed) 

Link to comment
Intenta así

server

local time = 3 --In seconds, time, when player is frozen 
  
function onParalyzed() 
local team = getPlayerTeam() 
    if (team and getTeamName(team) == "Policia") then 
    setPedFrozen ( source, true ) 
    setPedAnimation( source, "ped", "FLOOR_hit_f") 
    
    setTimer(setPedFrozen, time * 1000, 1, source, false) 
    setTimer(setPedAnimation, time * 1000, 1, source) 
end 
end 
  
addEvent("onParalyze", true) 
addEventHandler("onParalyze", getRootElement(), onParalyzed) 

Necesitas poner un jugador en 'getPlayerTeam'.

Intenta esto:

function onFire(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) 
 if getTeamName( getPlayerTeam( source ) ) == "Policia" then 
    if weapon == weaponid then 
        if hitElement then 
        if getElementType(hitElement) == "player" and hitElement ~= localplayer then 
            if shotmsg then 
                outputChatBox(smsg .. getPlayerName(hitElement), 0, 255, 0) 
            end 
            triggerServerEvent("onParalyze", hitElement) 
        else 
            if nshomsg then 
                outputChatBox(nmsg, 255, 0 ,0) 
            end 
        end 
    end 
end 
end 
end 
  
addEventHandler( "onClientPlayerWeaponFire", getRootElement(), onFire) 

Link to comment

Es que no lo estoy testeando, ya que no estoy en mi casa.

local time = 3 --In seconds, time, when player is frozen 
  
function onParalyzed() 
local team = getPlayerTeam(player) 
    if (team and getTeamName(team) == "Policia") then 
    setPedFrozen (player, true ) 
    setPedAnimation(player, "ped", "FLOOR_hit_f") 
    
    setTimer(setPedFrozen, time * 1000, 1, player, false) 
    setTimer(setPedAnimation, time * 1000, 1, player) 
end 
end 
  
addEvent("onParalyze", true) 
addEventHandler("onParalyze", getRootElement(), onParalyzed) 

Link to comment
Es que no lo estoy testeando, ya que no estoy en mi casa.
local time = 3 --In seconds, time, when player is frozen 
  
function onParalyzed() 
local team = getPlayerTeam(player) 
    if (team and getTeamName(team) == "Policia") then 
    setPedFrozen (player, true ) 
    setPedAnimation(player, "ped", "FLOOR_hit_f") 
    
    setTimer(setPedFrozen, time * 1000, 1, player, false) 
    setTimer(setPedAnimation, time * 1000, 1, player) 
end 
end 
  
addEvent("onParalyze", true) 
addEventHandler("onParalyze", getRootElement(), onParalyzed) 

'player' no esta definido en ningún lado.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...