-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
-- server side: addCommandHandler ( "ps1", function ( plays_1 ) if isAccountInGroup ( { "Owner", "Admin" }, getAccountName ( getPlayerAccount ( plays_1 ) ) ) then setTimer ( triggerClientEvent, 1000, 1, "playASound", root, "sounds/sound_1.mp3" ) else outputChatBox ("[info]: You have no acces to that command.", plays_1 ) end end ) function isAccountInGroup ( groups, account ) local theGroup = false for _, group in ipairs ( groups ) do if isObjectInACLGroup ( "user.".. account, aclGetGroup ( group ) ) then theGroup = group break end end return theGroup end -- client side: addEvent ( "playASound", true ) addEventHandler ( "playASound", root, function ( path ) playSound ( path ) end )
-
Yes, the method you were using wasn't safe.
-
function mensagemEvento ( thePlayer ) -- You forgot to defien 'thePlayer' local accountname = getAccountName ( getPlayerAccount ( thePlayer ) ) if (isObjectInACLGroup ( "user.".. accountname, aclGetGroup ( "Admin" ) )) then outputChatBox ( "#00FFFFUm To Enter the Event write /participar in chat", getRootElement(), 255, 0, 0, true ) end end addCommandHandler ( "eventodeagle", mensagemEvento ) -- This has to go after you close the function with the 'end' Read comments.
-
function submitReg ( ) local firstserial = getPlayerSerial ( source ) local moneys = getPlayerMoney ( source ) local data = dbPoll ( dbQuery ( server, "SELECT money FROM accounts WHERE serial = ?", firstserial ), - 1 ) if ( type ( data) == "table" and #data > 0 ) then dbExec ( server, "UPDATE accounts SET money = ? WHERE serial = ?", moneys, firstserial ) else dbQuery ( server, "INSERT INTO accounts ( serial, money ) VALUES ( ?, ? )", tostring ( firstserial ), tostring ( moneys ) ) end end addEventHandler ( "onPlayerQuit", root, submitReg )
-
I think that "??" is used for column and table names and "?" is used for values.
-
What do you mean by "not back"?
-
What do you mean by "save the serial as nil"? the setMoney function is meant to load the money, so how can it "save the serial"?
-
What are you trying to do?
-
Didn't you check the topic creation date? it was two years ago!
-
Place all of three scripts in a single .lua file and rename function names.
-
If you are using it without a loop, then you need to include the [ 1 ] before the column name from which you wish to obtain it's value, this "1" represents the index.
-
local query = dbQuery ( handler, "SQL STRING HERE" ) local data = dbPoll ( query, - 1 ) -- -1 = wait for the result, freezes server until it has the result. if ( type ( data ) == "table" ) then print ( data [ 1 ].myColumnName ) end
-
local money = { [ 1 ] = math.random ( 150, 400 ), [ 2 ] = math.random ( 400, 600 ), [ 3 ] = math.random ( 600, 800 ), [ 4 ] = math.random ( 800, 1000 ), [ 5 ] = math.random ( 800, 1000 ), [ 6 ] = math.random ( 800, 1000 ), } addEventHandler ( "onPlayerDamage", getRootElement(), function ( attacker, weapon, bodypart, loss ) givePlayerMoney ( attacker, money [ 1 ] ) end )
-
local money = { [ 1 ] = math.random ( 150, 400 ), [ 2 ] = math.random ( 400, 600 ), [ 3 ] = math.random ( 600, 800 ), [ 4 ] = math.random ( 800, 1000 ), [ 5 ] = math.random ( 800, 1000 ), [ 6 ] = math.random ( 800, 1000 ), } addEventHandler ( "onPlayerDamage", getRootElement(), function ( attacker, weapon, bodypart, loss ) givePlayerMoney ( attacker, money [ math.random ( #money ) ] ) end ) That's what you wanted?
-
You're welcome.
-
function VIPMENUTRIGGER ( thePlayer , commandName ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "VIP" ) ) then triggerClientEvent ( thePlayer, "VIPSuccess", thePlayer ) else outputChatBox ( "VIP deilsin!!Vip icin : [url=http://www.yvgaming.de]www.yvgaming.de[/url] ye git!", thePlayer ) end end addCommandHandler ( "vip", VIPMENUTRIGGER )
-
Yes, now it's correct.
-
http://pastebin.com/cbvvR57a
-
bindKey server side has a player argument, bind the key when the player joins ( onPlayerJoin event ).
-
You added a extra "5". gs1 = createObject ( 975, 2522.8999023438, -1722.1999511719, 13.39999961853, 0, 0, 179.74182128906 ) function gateOpen ( ) moveObject ( gs1, 5000, 2515.3999023438, -1722.1999511719, 13.39999961853 ) end addCommandHandler ( "gss", gateOpen ) function gateClose ( ) moveObject ( gs1, 5000, 2522.8999023438, -1722.1999511719, 13.39999961853 ) end addCommandHandler ( "gsd", gateClose )
-
Yeah, that's correct, if you want it faster, then lower the time.
