Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. What do you mean by "markers changed for every player"?
  2. No, textItemGetColor devuelve 4 argumentos: r, g, b, a. r, g, b = textItemGetColor ( redtext ) if ( r == 0 ) and ( g == 255 ) and ( b == 0 ) then textItemSetColor ( theTextItem, 0, 0, 255, 255 ) end
  3. textItemSetColor textItemSetScale Para poner textos server side no existe otra funcion.
  4. No podes cambiar la fuente de estos textos.
  5. Well, the main problem is that you used server side events instead of client side: onResourceStart instead of onClientResourceStart onMarkerHit instead of onClientMarkerHit onMarkerLeave instead of onClientMarkerLeave Also, the event handlers for each button had to be inside the function where you create them. And, you we're setting alpha of non-existent elements, you forgot to rename it when you renamed button variables. theMarker = createMarker ( 295.83984375, -80.8115234375, 1001.515625, "cylinder", 1.5, 255, 255, 0, 0 ) function startUp ( ) setElementInterior ( theMarker, 4, 295.83984375, -80.8115234375, 1001.515625 ) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Window[1] = guiCreateWindow(463,170,437,246,"",false) guiSetAlpha(GUIEditor_Window[1],1) sellDeagle = guiCreateButton(16,37,112,47,"Desert Eagle",false,GUIEditor_Window[1]) guiSetAlpha(sellDeagle,1) sellM4 = guiCreateButton(16,94,112,47,"M4",false,GUIEditor_Window[1]) guiSetAlpha(sellM4,1) sellTec9 = guiCreateButton(16,152,112,47,"Tec9",false,GUIEditor_Window[1]) guiSetAlpha(sellTec9,1) sellShotgun = guiCreateButton(162,152,112,47,"Shotgun",false,GUIEditor_Window[1]) guiSetAlpha(sellShotgun,1) sellRifle = guiCreateButton(162,94,112,47,"Rifle",false,GUIEditor_Window[1]) guiSetAlpha(sellRifle,1) sellSniper = guiCreateButton(162,36,112,47,"Sniper Rifle",false,GUIEditor_Window[1]) guiSetAlpha(sellSniper,1) sellColt = guiCreateButton(304,94,112,47,"Colt 45.",false,GUIEditor_Window[1]) guiSetAlpha(sellColt,1) sellMac10 = guiCreateButton(304,152,112,47,"Mac-10",false,GUIEditor_Window[1]) guiSetAlpha(sellMac10,1) sellAK47 = guiCreateButton(304,34,112,47,"AK47",false,GUIEditor_Window[1]) guiSetAlpha(sellAK47,1) guiSetVisible ( GUIEditor_Window[1], false ) addEventHandler ( "onClientGUIClick", sellDeagle, sellDeagle1, false ) addEventHandler ( "onClientGUIClick", sellM4, sellM41, false ) addEventHandler ( "onClientGUIClick", sellTec9, sellTec91, false ) addEventHandler ( "onClientGUIClick", sellShotgun, sellShotgun1, false ) addEventHandler ( "onClientGUIClick", sellRifle, sellRifle1, false ) addEventHandler ( "onClientGUIClick", sellSniper, sellSniper1, false ) addEventHandler ( "onClientGUIClick", sellColt, sellColt1, false ) addEventHandler ( "onClientGUIClick", sellMac10, sellMac101, false ) addEventHandler ( "onClientGUIClick", sellAK47, sellAK471, false ) end addEventHandler ( "onClientResourceStart", resourceRoot, startUp ) function onMarker ( hitElement ) if ( hitElement == localPlayer ) then guiSetVisible ( GUIEditor_Window[1], ( eventName == "onClientMarkerHit" and true or false ) ) end end addEventHandler ( "onClientMarkerHit", theMarker, onMarker ) addEventHandler ( "onClientMarkerLeave", theMarker, onMarker ) function sellDeagle1 ( ) if button == "left" and state == "up" then triggerServerEvent ( "sellDeagle", getLocalPlayer()) outputChatBox ( "You Have Bought 100 Ammo Of Deagle" ) end end function sellM41 ( ) if button == "left" and state == "up" then triggerServerEvent ( "sellM4", getLocalPlayer()) outputChatBox ( "You Have Bought 100 Ammo Of M4" ) end end function sellTec91 ( ) if button == "left" and state == "up" then triggerServerEvent ( "sellTec9", getLocalPlayer()) outputChatBox ( "You Have Bought 100 Ammo Of Tec9" ) end end function sellShotgun1 ( ) if button == "left" and state == "up" then outputChatBox ( "You Have Bought 100 Ammo Of Shotgun" ) end end function sellRifle1 ( ) if button == "left" and state == "up" then triggerServerEvent ( "sellRifle", getLocalPlayer()) outputChatBox ( "You Have Bought 100 Ammo Of Country Rifle" ) end end function sellSniper1 ( ) if button == "left" and state == "up" then triggerServerEvent ( "sellSniper", getLocalPlayer()) outputChatBox ( "You Have Bought 100 Ammo Of Sniper" ) end end function sellColt1 ( ) if button == "left" and state == "up" then triggerServerEvent ( "sellColt", getLocalPlayer()) outputChatBox ( "You Have Bought 100 Ammo Of Colt 45." ) end end function sellMac101 ( ) if button == "left" and state == "up" then triggerServerEvent ( "sellMac10", getLocalPlayer()) outputChatBox ( "You Have Bought 100 Ammo Of Mac-10" ) end end function sellAK471 ( ) if button == "left" and state == "up" then triggerServerEvent ( "sellAK47", getLocalPlayer()) outputChatBox ( "You Have Bought 100 Ammo Of AK47" ) end end You really should start using debugscript.
  6. -- client side. addEvent ( "getlist", true ) function Listing ( user ) local addrow = guiGridListAddRow ( UsrList ) guiGridListSetItemText ( UsrList, addrow, Col, user, false, false ) end addEventHandler ( "getlist", getRootElement(), Listing ) -- server side: function UsrList ( playerSource ) local result = mysql:query ( "SELECT username FROM accounts" ) if ( result ) then while true do local row = mysql:fetch_assoc ( result ) if ( not row ) then break end triggerClientEvent ( playerSource, "getList", playerSource, row [ "username" ] ) end end end addCommandHandler ( "dbmanl", UsrList ) Try it.
  7. Your events server side are: "ShowMenuC" and "notify". Your event client side is: "telluser".
  8. Post the client side part, TheNightRider.
  9. Copy my code again, it should work now.
  10. Castillo

    ipairs

    skins = { 0, 50, 48, 150 } On top of script.
  11. Castillo

    ipairs

    No, that's a function.
  12. Castillo

    ipairs

    Where is "skins" table defined?
  13. If I'm right, these errors we're there when the player was not on the table(s).
  14. They don't match either, the line numbers are still wrong, though I may be able to fix them anyway. http://pastebin.com/83v3g8N6 Replace from line 1 to 500 in your complete script.
  15. All the error line numbers are wrong, none of them is the right one at the pastebin code.
  16. Of course we need it, how are we going to help if we don't have it?
  17. I just tried the script, works fine, I hit the first marker, it created second, and so on.
  18. What i understood is that you have a column in your table which is where the level is defined. mysql = exports.mysql function showmenu ( playerSource )--check user has rights or not. local result = mysql:query_fetch_assoc ( "SELECT admin FROM `accounts` WHERE `username`='".. getPlayerName ( playerSource ) .."'" ) if ( result and tonumber ( result [ "admin" ] ) >= 6 ) then -- Check if the level is 6 or higher. triggerClientEvent ( playerSource, "ShowMenuC", playerSource, true )--show user interface. outputChatBox ( 'I did something YAY XD', playerSource );-- test if working or not else triggerClientEvent ( playerSource, "notify", playerSource, true )--tell user. outputChatBox ( 'Sorry No Can Do!!!', playerSource );-- test if working or not end end addCommandHandler ( "dbman", showmenu )
  19. What you are saying is that it doesn't do anything when you hit the marker?
  20. Castillo

    not work .!

    He wants to make a progress bar like that one. You can either use: dxDrawRectangle Or two GUI images ( black and red ): guiCreateStaticImage
×
×
  • Create New...