Jump to content

Help


yMassai

Recommended Posts

local Toyota = getElementData(source,'Level') 
  
addEventHandler('onClientGUIClick', root, 
function() 
if (source == buttonAlterar) then 
guiSetText(editWanted2, Toyota) 
setPlayerWantedLevel ( thePlayer, 'Level' ) 
end 
end) 

This?

Link to comment
Guest Guest4401

setPlayerWantedLevel is only serverside function.

You can't use it clientside. You must trigger it with triggerServerEvent.

Link to comment

sorry for the lack of attention

and now?

local Toyota = getElementData(source,'Level') 
  
addEventHandler('onClientGUIClick', root, 
function() 
if (source == buttonAlterar) then 
guiSetText(editWanted2, Toyota) 
setPlayerWantedLevel ( thePlayer, 'Level' ) 
triggerServerEvent("onClientNumber", localPlayer, "setLevel") 
end 
end) 

Link to comment
---ClientSide 
local Toyota = getElementData(localPlayer,'Level') 
addEventHandler('onClientGUIClick', root, 
function() 
if (source == buttonAlterar) then 
guiSetText(editWanted2, Toyota) 
triggerServerEvent('onStupidStar',localPlayer) 
end 
end) 
  
---serverSide 
addEvent('onStupidStar', true) 
addEventHandler('onStupidStar', root, 
function(player) 
setPlayerWantedLevel( player, 1) 
outputChatBox('Wanted Level Has Been Set to 1 !',player,255,255,0) 
end) 

Link to comment

Client

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
function CriarJanela() 
local root = getRootElement() 
    wantedJanela = guiCreateWindow(80,80,250,250,"",false) 
    guiWindowSetSizable(wantedJanela,false) 
--labels 
    labelJanela = guiCreateLabel(20,20,250,60,"Janela de Alteração de Wanted Stats",false,wantedJanela) 
    labelNome = guiCreateLabel(10,55,250,60,"Nome do Jogador :",false,wantedJanela) 
    labelWanted = guiCreateLabel(30,90,250,60,"Wanted Level :",false,wantedJanela) 
--edit 
    editWanted1 = guiCreateEdit(120,50,120,25,"",false,wantedJanela) 
    editWanted2 = guiCreateEdit(160,85,80,25,"",false,wantedJanela) 
  
--Memo 
    memoEdit = guiCreateMemo(10,120,230,80,"Identifique o jogador e selecione o nivel de procurado para a alteração, os niveis podem ser de 0-6 .",false,wantedJanela) 
  
--Button 
    buttonAlterar = guiCreateButton(0,210,120,30,"Alterar Nivel",false,wantedJanela) 
  
    buttonFechar = guiCreateButton(130,210,120,30,"Fechar",false,wantedJanela) 
    guiSetVisible ( wantedJanela, false ) 
    showCursor ( false ) 
end 
addEventHandler( "onClientResourceStart", getRootElement( ), CriarJanela) 
  
addEventHandler('onClientGUIClick', root, 
function () 
if ( source == buttonFechar) then 
guiSetVisible ( wantedJanela, false ) 
showCursor ( false ) 
end 
end) 
addEventHandler('onClientGUIClick', root, 
function () 
if ( source == buttonAlterar) then 
guiSetVisible ( JanelaSec, true ) 
showCursor ( true ) 
end 
end) 
  
function Visible () 
     guiSetVisible ( wantedJanela, true ) 
     showCursor(true) 
 end 
addCommandHandler ( "wantedstats", Visible ) 
  
local Toyota = getElementData(source,'Level') 
  
addEventHandler('onClientGUIClick', root, 
function() 
if (source == buttonAlterar) then 
guiSetText(editWanted2, Toyota) 
end 
end) 

Secundário

anelaSec = guiCreateWindow(200,150,200,120,"",false) 
MemoSec = guiCreateLabel(10,20,200,200,"     Você deseja relamnete \nalterar onivel de procurado deste \njogador?",false,JanelaSec) 
ButtonSec1 = guiCreateButton(0,80,90,100,"Confirmar",false,JanelaSec) 
ButtonSec2 = guiCreateButton(100,80,90,100,"Cancelar",false,JanelaSec) 
    guiWindowSetSizable(JanelaSec,false) 
    guiSetVisible(JanelaSec,false) 
  
addEventHandler('onClientGUIClick', root, 
function () 
if ( source == ButtonSec2) then 
guiSetVisible ( JanelaSec, false ) 
end 
end) 
  
addEventHandler('onClientGUIClick', root, 
function() 
if (source == ButtonSec1) then 
local who = getPlayerName(localPlayer) 
if ( who) then 
guiSetText(editWanted1, who) 
end 
end) 
  
local Toyota = getElementData(localPlayer,'Level') 
  
addEventHandler('onClientGUIClick', root, 
function() 
if (source == ButtonSec1) then 
guiSetText(editWanted2, Toyota) 
triggerServerEvent('onStupidStar',localPlayer) 
end 
end) 

Server

addEvent('onStupidStar', true) 
addEventHandler('onStupidStar', root, 
function(player) 
setPlayerWantedLevel( player, 1) 
outputChatBox('Wanted Level Has Been Set to 1 !',player,255,255,0) 
end) 

How im doing? do a error.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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