-
Posts
1,390 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Et-win
-
Good, because by then you would know the entered variable was 'nil'.
-
function weapons ( ) if not (isAllownedPlayer(localPlayer)) then return end outputChatBox("Test1") local x,y,z = getElementPosition(localPlayer) local minigunw = createWeapon("minigun", x, y, z + 1) setWeaponClipAmmo ( minigunw,99999) setWeaponState ( minigunw,"firing") for _, player in ipairs(getElementsByType("player")) do xz , xs , xt = getElementPosition (player) setWeaponTarget ( minigunw , xz , xs , xt ) end end end addCommandHandler("mini", weapons) *Also wonders why the weapon functions are not linked + colored*
-
function weapons ( thePlayer) if not (isAllownedPlayer(thePlayer)) then return end outputChatBox("Test1") local x,y,z = getElementPosition(thePlayer) local minigunw = createWeapon("minigun", x, y, z + 1) setWeaponClipAmmo ( minigunw,99999) setWeaponState ( minigunw,"firing") for _, player in ipairs(getElementsByType("player")) do xz , xs , xt = getElementPosition (player) setWeaponTarget ( minigunw , xz , xs , xt ) end end end addCommandHandler("mini", weapons) Guess it is server-sided. Does it output "Test1" ?
-
... function onLogin(previousAccount, currentAccount) if not getAccountData(currentAccount, "p_money") or not getAccountData(currentAccount, "p_money") == nil then setAccountData(currentAccount, "p_money", 0) end end addEventHandler("onPlayerLogin", root, onLogin) Even though you have your answer now, I still want you to answer this question: Do you even use debugscript 3?
-
function weapons ( localPlayer) if not (isAllownedPlayer(thePlayer)) then return end Parameter wrong.
-
Because you are starting both 'moveGate' and 'moveBack' functions when you hit the marker.
-
-
No, everything was correct. But you have to start function 'PanelAdmin' as soon as the resource starts. Then inside the function 'PanelAdmin', set the 'window' invisible with 'guiSetVisible'.
-
account thePreviousAccount, account theCurrentAccount, bool autoLogin @ onPlayerLogin. So...... You are getting the PREVIOUS account now. Get the CURRENT account.
-
function moveGate() if getAccountName(getPlayerAccount(source)) == "Florjan22" then moveObject(gate, 5000, 1556.36, -2348.79, 16.54) end end addEventHandler("onPlayerMarkerHit", marker, moveGate) EDIT: Changed 'onPlayerMarkerHit' so it only activates when a player enters. In your function you forgot to define 'player' in the function.
-
Ah, just asking. Don't mind me. *cough* But you didn't start function 'PanelAdmin', so 'guiGetVisible' can't find 'window'. Just start the function, and on the last line before 'end' set it invisible.
-
If I was you I should use what Sasu just said.
-
You didn't look what I did. local gPlayerAccount = getPlayerAccount(player) if (gPlayerAccount ~= false) and (isGuestAccount(gPlayerAccount) == false) then First get the player's account and check or he is logged in, if so, if not on Guest account, then continue.
-
triggerClientEvent("onDeleteHands", root, playerTable) Probably to: triggerClientEvent(v, "onDeleteHands", root, playerTable)
-
1. What error? 2. function onKeyUse( element ) if ( hasObjectPermissionTo ( element, "function.setServerPassword", true ) ) then triggerClientEvent( element, "Show", element ) end end I hope you aren't going to put backdoors in and put it online?
-
It means there already is an event handler for that function with the same event.
-
Did you do the other functions too? And you need to add event 'onPlayerLogin' and then give the player her/his money.
-
Btw, why like this? Because on every frame it re-creates the codes you have in that function which is on event 'onClientRender'. (Because it's only created for 1 frame only) Which means, variables are awesome!
-
local gMap = exports.mapmanager:getRunningGamemodeMap() local mapRoot = getResourceRootElement(gMap) getElementsByType("sound", mapRoot)
-
--Server function getPlayerMoney ( player ) local m = false local gPlayerAccount = getPlayerAccount(player) if (gPlayerAccount ~= false) and (isGuestAccount(gPlayerAccount) == false) then m = tonumber ( getAccountData ( gPlayerAccount, "p_money" ) ) if ( not m ) then m = 0 setAccountData ( player, "p_money", 0 ) end end return m end I did the first one, you can do the rest (getPlayerAccount(player)) (If the player was not logged in, then it returns 'false')
-
First get the player's account, and then do set/getAccountData.
