-
Posts
365 -
Joined
-
Last visited
Posts posted by SkatCh
-
-
sorry i don't undrestand can you explane to me.
this is my script ;
- server side
addEventHandler("onResourceStart", getRootElement(), function(theMap) local playerList = getPlayersName() if playerList then callRemote("My website", returnFunction, playerList) end end) function returnFunction(value) if value ~= "ERROR" then outputDebugString("done") end end function getPlayersName() local playerslist = {} for i,p in ipairs (getElementsByType("player")) do local thep = string.gsub(getPlayerName(p), "#%x%x%x%x%x%x", "") table.insert(playerslist,tostring(thep)) end return playerslist end
and what i need to add inside the PHP
-
bro i'm asking about the php part i already told you that my script is working fine , juts my question is what i need to type inside the php file.
-
hi guys please i need some help , i have a simple question how can add players names inside my website using php sdk i know how to use callRemote , i add this and it's working fine i can see 'done' in my debugString but what i need to do to finish the php file.
addEventHandler("onResourceStart", getRootElement(), function(theMap) local playerList = getPlayersName() if playerList then callRemote("My website", returnFunction, playerList) end end) function returnFunction(value) if value ~= "ERROR" then outputDebugString("done") end end function getPlayersName() local playerslist = {} for i,p in ipairs (getElementsByType("player")) do local thep = string.gsub(getPlayerName(p), "#%x%x%x%x%x%x", "") table.insert(playerslist,tostring(thep)) end return playerslist end
-
so how can i change it .
-
Hi guys , please i have a question can anyone tell me jetpack it's a weapon or an object .
How can i change it to an other one (mod) . i have a dff and txd file but i don't know what i need to do to replace it .
-
guys any help.
-
any help just i need to check if the player is coughing to stop him. is it possible using this function
isPedChoking
-
sorry guys no one gave me the right answer , can anyone tell me how to stop coughing .
-
i know evrey thing about how to stop damage etc but the player still coughing when i use the sprycan to heal him.
-
Hi guys please i have a simple question and i need answer , how can i stop player coughing when i use spraycan as a medic ?
-
hi guys please i have a simple question , can anyone explane to me when i need to use :
- root
with triggerClientEvent ("Eventname",root)
-
Use this function :
local x,y = guiGetScreenSize()
-
Sorry i think you don't undrestand my question , read it one more time.
-
Sorry Topic can be deleted.
-
onClientDXMouseEnter
onClientDXClick
What are you serious.
-
-
Here you go e.g:
local x = -- x coordination local y = -- y coordination local z = -- z coordination addEventHandler("onClientRender",getRootElement(), function() local px,py,pz = getElementPosition(getLocalPlayer()) local distance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) if distance <= 150 then local sx,sy = getScreenFromWorldPosition ( x, y, z+0.95, 0.06 ) if not sx then return end local scale = 1/(0.3 * (distance / 150)) dxDrawText ( "XeroxMTA", sx, sy - 30, sx, sy - 30, tocolor(255,255,255,255), math.min ( 0.4*(150/distance)*1.4,4), "bankgothic", "center", "bottom", false, false, false ) end end )
-
Try this :
local sql = dbQuery(handler,"SELECT * FROM bag") local resultTable = dbPoll(sql, -1) if resultTable then for rowNum, rowData in pairs(resultTable) do local bID = rowData['ID'] local newID = bID + 1 dbExec(handler,"INSERT INTO bag (TYPE) VALUES ('1')") outputChatBox("ADD BAGBACK ID "..tonumber(newID).."",source,125,0,0,true)
-
function checkShipment(button, state, thePlayer) local level = getElementData(thePlayer, "level") if (source==bCheck) then if (button ~= "left" or state ~= "down") then return end -- < your code here > end end
-
i know that u can do it just never give up , you are welcome
-
Next time try to fix it by yourself . Never give up
Anyway :
-- Client side:
local getPlayerRow = {} isVisible = false function createGui() local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 283, 410 local windowX, windowY = (screenWidth / 2) - (windowWidth / 2), (screenHeight / 2) - (windowHeight / 2) mainWnd = guiCreateWindow(windowX, windowY, windowWidth, windowHeight, "Player Manager", false) tabPanel = guiCreateTabPanel(0, 0.1, 1, 1, true, mainWnd) guiSetVisible(mainWnd, true) showCursor(true) tabAcc = guiCreateTab("Accounts", tabPanel) accountGrid = guiCreateGridList(9, 23, 249, 228, false, tabAcc) guiGridListSetSelectionMode(accountGrid, 0) refreshButton = guiCreateButton(9, 258, 80, 26, "Refresh", false, tabAcc) deleteButton = guiCreateButton(110, 258, 80, 26, "Delete", false, tabAcc) closeButton = guiCreateButton(228, 258, 26, 26, "X", false, tabAcc) guiGridListAddColumn(accountGrid, "Account Name", 0.91) triggerServerEvent("serverGetAccounts", localPlayer, localPlayer) tabSerial = guiCreateTab("Serials", tabPanel) playerGrid = guiCreateGridList(9, 23, 249, 228, false, tabSerial) guiGridListAddColumn(playerGrid, "Name", 0.91) guiGridListSetSelectionMode(playerGrid, 0) refreshButton = guiCreateButton(9, 258, 80, 26, "Refresh", false, tabSerial) fetchButton = guiCreateButton(110, 258, 80, 26, "Fetch", false, tabSerial) closeButton = guiCreateButton(228, 258, 26, 26, "X", false, tabSerial) editUser = guiCreateEdit(5, 300, 255, 30, "", false, tabSerial) triggerServerEvent("serverGetPlayers", localPlayer, localPlayer) end function handleCommand() if (isVisible == false) then isVisible = true createGui() elseif (isVisible == true) then guiSetVisible(mainWnd, false) showCursor(false) isVisible = false end end addCommandHandler("plr", handleCommand) --------------------------------- -- Account manager --------------------------------- function refreshGridlist(accountTable) guiGridListClear(accountGrid) for index, account in ipairs(accountTable) do local row = guiGridListAddRow(accountGrid) guiGridListSetItemText(accountGrid, row, 1, tostring(account), false, false) end end addEvent("serverGivesAccounts", true) addEventHandler("serverGivesAccounts", getRootElement(), refreshGridlist) function buttonHandler() if (source == refreshButton) then triggerServerEvent("serverGetAccounts", localPlayer, localPlayer) elseif (source == deleteButton) then local row,col = guiGridListGetSelectedItem(accountGrid) if row and col and row ~= -1 and col ~= -1 then local targetAccount = guiGridListGetItemText(accountGrid, row, 1) triggerServerEvent("requestAccountDelete", localPlayer, targetAccount) triggerServerEvent("serverGetAccounts", localPlayer, localPlayer) end end if (source == closeButton) then guiSetVisible(mainWnd, false) showCursor(false) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), buttonHandler) --------------------------------- -- Serial Manager --------------------------------- -- Add players to grid list: function addPlayersToGridlist() guiGridListClear(playerGrid) for index, players in pairs(getElementsByType("player")) do local row = guiGridListAddRow(playerGrid) local name = getPlayerName(players) guiGridListSetItemText(playerGrid, row, 1, name, false, false) getPlayerRow[players] = row end end addEvent("serverGivesPlayers",true) addEventHandler("serverGivesPlayers",root,addPlayersToGridlist) function buttonHandler2() -- Fetch button if (source == fetchButton) then local row,col = guiGridListGetSelectedItem(playerGrid) if row and col and row ~= -1 and col ~= -1 then local targetPlayer = guiGridListGetItemText(playerGrid, row, 1) local serial = getPlayerSerial (targetPlayer ) guiSetText(editUser,serial) end end -- Refresh button if (source == refreshButton) then guiGridListClear(playerGrid) for k,v in ipairs (getElementsByType("player")) do local name = string.lower(getPlayerName(v)) if (name) then local row = guiGridListAddRow(playerGrid) guiGridListSetItemText(playerGrid,row,1,getPlayerName(v),false,false) getPlayerRow[v] = row end end end -- Close button if (source == closeButton) then guiSetVisible(mainWnd, false) showCursor(false) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), buttonHandler2)
-- server side:
--------------------------------- -- Account manager --------------------------------- function getTheAccounts(client) accountTable = getAccounts() local tempTable = {} if(#accountTable == 0)then outputDebugString("No accounts in database!") else for index, account in pairs(accountTable) do table.insert(tempTable, getAccountName(account)) end triggerClientEvent(client, "serverGivesAccounts", client, tempTable) end end addEvent("serverGetAccounts", true) addEventHandler("serverGetAccounts", getRootElement(), getTheAccounts) function deleteAccount(targetAccount) if getAccount(targetAccount) then removeAccount(getAccount(targetAccount)) outputChatBox("The account "..targetAccount.." has been deleted.") end end addEvent("requestAccountDelete", true) addEventHandler("requestAccountDelete", getRootElement(), deleteAccount) function getThePlayers(client) triggerClientEvent(client, "serverGivesPlayers", client) end addEvent("serverGetPlayers", true) addEventHandler("serverGetPlayers", getRootElement(), getThePlayers)
-
First calm down,
Second It is not that serious like you are thinking, Its just a freaking script.
Third your "ffffaasssst!!!!111" will not make it any better for us to help you, after all it is in our hands to help you or not.
Fourth and last, try your self to fix it using the following function:-
setElementVisibleTo
i agree with you , anyway he already gave u the correct answer.
-
put ur funticon :
funtion () -- here end
-
It's easy just just you need to use "triggerClientEvent" .
e.g:
-- Client side:
addEvent("Sound",true) addEventHandler("Sound", getRootElement(), function() local Sound = playSound(".........mp3") -- put your sound file here setSoundVolume(Sound, 1) end)
-Server side:
triggerClientEvent(........, "Sound",......)
about PHP sdk
in Scripting
Posted
bro can explane more what i need to write inside the PHP file