Jump to content

ayuda con algo facil


cuervox123

Recommended Posts

Posted

bueno lo q pasa es que he estado haciendo un admp y haciendo una funcion de zapear,no se como hacer que el lado del server me lea como source triggeando desde el client,o bueno no me ha salido,quisiera pedir el favor de que alguien me muestre el codigo correcto,aqui el codigo.

C:

function zapp(source) 
if guiGridListGetSelectedItem(gridlistap) ~= -1 then 
do 
local play = getPlayerFromName(guiGridListGetItemText(gridlistap, guiGridListGetSelectedItem(gridlistap), 1)) 
if play then 
guiSetText(LabelPlayer, getPlayerName(play)) 
local ply = guiGetText(LabelPlayer) 
triggerServerEvent ("zap", play, ply, source) 
end 
end 
end 
end 
addEventHandler("onClientGUIClick", zap, zapp) 

S:

function zapeo (play) 
    local ply = getPlayerFromName (play) 
    if ply then 
        if ( hasObjectPermissionTo( source, 'command.ban', true ) ) then 
            if getElementData(ply, "Lv") <= getElementData(source, "Lv") then 
                outputDebugString (getPlayerName(source).." Zapeo a "..play)   
                local x, y, z = getElementPosition (ply) 
                bom = {} 
                bom[1] = createMarker (x+5, y, z, "corona", 2, 0, 120, 0, 255) 
                bom[2] = createMarker (x-5, y, z, "corona", 2, 0, 120, 0, 255) 
                bom[3] = createMarker (x, y+5, z, "corona", 2, 0, 120, 0, 255) 
                bom[4] = createMarker (x, y-5, z, "corona", 2, 0, 120, 0, 255) 
                setTimer (killPed, 9500, 1, ply) 
                 
                attachElements (bom[1], ply, 5, 0, 0) 
                attachElements (bom[2], ply, -5, 0, 0) 
                attachElements (bom[3], ply, 0, 5, 0) 
                attachElements (bom[4], ply, 0, -5, 0) 
                for i, v in ipairs (bom) do 
                    setTimer (setMarkerColor, 3000, 1, v, 120, 0, 0, 255) 
                    setTimer (destroyElement, 10000, 1, v) 
end 
end 
end 
end 
end 
addEvent ("zap", true) 
addEventHandler ("zap", root, zapeo) 

Posted

Nose que quisiste hacer al poner el ciclo Do. Pruebalo.

function zapp() 
if guiGridListGetSelectedItem(gridlistap) ~= -1 then 
local play = getPlayerFromName(guiGridListGetItemText(gridlistap,guiGridListGetSelectedItem(gridlistap), 1)) 
if play then 
guiSetText(LabelPlayer, tostring(play)) 
local ply = guiGetText(LabelPlayer) 
triggerServerEvent ("zap", localPlayer, ply) 
end 
end 
end 
addEventHandler("onClientGUIClick", zap, zapp) 

if ( hasObjectPermissionTo( ply, 'command.ban', true ) ) then 

Posted

Gaberiel agradezco tu interés .pero no me ha servido,mira donde dice source en el server,quiero q me tome a mi como ese soruce y el ply lo tome como al jugador q seleccione en el LabelPlayer por que no me ha dado..rare

Posted

Sabes por qué no funciona?

Te falto ponerle su evento original, llamado 'szap-serginix'

Por favor, deja de ser tan estúpido al creer que nadie se dará cuenta que es parte de un recurso robado, y lo estás usando sin el concentimiento del creador, aquí ayudamos a los que en verdad lo requieren, no ratas lucradas de mierda como usted que está usando el esfuerzo de otro a costa de todo :D:)

Posted

addEvent ("zap", true)

addEventHandler ("zap", root, zapeo)

triggerServerEvent ("zap", localPlayer, ply)

con este si que me funciona y ya esta muy bien.... Solucionado pa que le duela mas :twisted:

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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