Jump to content

que esta mal ?


iFoReX

Recommended Posts

no puedo encontrar el error en este script asi que quiera ver si ustedes me ayudaban.

cl-side

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Edit = {} 
GUIEditor_Grid = {} 
  
GUIEditor_Window[1] = guiCreateWindow(0.21,0.09,0.55,0.815,"GUI Dar Dinero",true) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Grid[1] = guiCreateGridList(11,22,165,456,false,GUIEditor_Window[1]) 
  
col = guiGridListAddColumn(GUIEditor_Grid[1],"Players",0.2) 
GUIEditor_Label[1] = guiCreateLabel(274,106,36,17,"Monto",false,GUIEditor_Window[1]) 
GUIEditor_Edit[1] = guiCreateEdit(213,123,162,31,"",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(215,160,156,34,"Enviar",false,GUIEditor_Window[1]) 
  
guiSetVisible(GUIEditor_Window[1],false) 
showCursor(false) 
  
function addPlayers() 
local limpiada = guiGridListClear(GUIEditor_Grid[1]) 
if limpiada then 
for troll,lol in ipairs(getElementsByType("player")) do 
row = guiGridListAddRow(GUIEditor_Grid[1]) 
guiGridListSetItemText(GUIEditor_Grid[1],row,col,getPlayerName(lol),false,false) 
end 
end 
end 
addEventHandler("onClientResourceStart",resourceRoot,addPlayers) 
addEventHandler("onClientPlayerJoin",root,addPlayers) 
addEventHandler("onClientPlayerQuit",root,addPlayers) 
addEventHandler("onClientPlayerChangeNick",root,addPlayers) 
  
bindKey("F2","down",function() 
guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) 
showCursor(guiGetVisible(GUIEditor_Window[1])) 
end 
) 
  
  
  
addEventHandler("onClientGUIClick",root,function() 
if source == GUIEditor_Button[1] then 
local elPlayer = guiGridListGetItemText(GUIEditor_Grid[1],row,col) 
local getMonto = guiGetText(GUIEditor_Edit[1]) 
triggerServerEvent("lool",getLocalPlayer(),getMonto,elPlayer) 
triggerServerEvent("dar",getLocalPlayer()) 
end 
end 
) 
  

sv-side

addEvent("lool",true) 
addEventHandler("lool",root,function(getMonto,elPlayer) 
monto = getMonto 
Jugador = elPlayer 
end 
) 
  
addEvent("dar",true) 
addEventHandler("dar",root,function() 
local money = getPlayerMoney(source) 
if money >= tonumber(monto) then 
local succesfely = givePlayerMoney(getPlayerFromName(Jugador),monto) 
local myMoney = getPlayerMoney(source) 
local restar = setPlayerMoney(source,myMoney-tonumber(monto)) 
if succesfely then 
outputChatBox("Dinero Enviado con exito a "..Jugador,source,255,255,255,true) 
outputChatBox(source..",Te ha enviado $"..monto.."",Jugador,255,255,255,true) 
outputChatBox(source.."le ha enviado [$"..monto.."] a"..Jugador,getRootElement(),255,255,255,true) 
end 
end 
end 
) 
  

c:

Link to comment
  • Recently Browsing   0 members

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