# qadr\_panel

### [Admin panel url](http://redmcompanion.abdulkadiraktas.com.tr)

1. &#x20;First make the settings in the "conf.lua" file a. Set database name to this variable "qadrpanel.databasename" b. After that set user and password to qadrpanel.account
2. add "ensure qadr\_panel" to server.cfg file After redemrp scripts.
3. Please do not change "qadr\_panel" folder name.
4. If you need API handler I will explain. a. Client :&#x20;
   1. First check api-client.lua&#x20;
   2. For now only when the admin panel triggered "hprecovery" and "tpdone" you can handle&#x20;
   3. If you want to handle these events. You can set functions to clientRequestHandler&#x20;
   4. api-client.lua file has example b. Server :&#x20;
      1. First check api-server.lua&#x20;
      2. If you want to handle serverside requests add your code to serverRequestHandler functions&#x20;
      3. serverRequestHandler has "rType" value has one of these data : <br>

         ```lua
         local rType = {
             {data="loginchecker",value = return boolean},
          or {data="updateUser", value = return object}, object = { value = string, fieldname = string, 
         playerserverid = integer}
          or {data="kickedPlayer",value = return object}, object = { playerserverid = number, reason = 
         string}
          or {data="apikey", value = return string}, string = apikey
          or {data="tableUpdate", value = return object}, object = { account = string, pass = string, apikey 
         = string, primarykey = string, fieldname = string, value = string, table = string, primarykeydata 
         = string}
          or {data="createPage", value = return object}, object = { pagename = string, tablename = string, 
         primarykey = string, columun = string}
          or {data="deletePage", value = return string}, string = tableName
          or {data="additemtoplayer", value = return object}, object = { playerserverid = integer, itemname 
         = string, itemcount = integer, isItemWasAdded = boolean }
          or {data="addmoneytoplayer",value = return object}, object = { playerserverid = integer, money = 
         integer, isMoneyWasAdded = boolean }
          or {data="setfullhp", value = return integer},integer = playerserverid
          or {data="setPlayerCoords", value = return object}, object = { playerserverid = integer, coords = 
         vector3}
         }
         If you want to handle events, use like this to api-server.lua :
         serverRequestHandler = function(rType)
         	if rType.data == "loginchecker" then
         		print(rType.value)
         	end
         	if rType.data == "updateUser" then
         		print(rType.value.value)
         		print(rType.value.fieldname)
         		print(rType.value.playerserverid)
         	end
         	if rType.data == "kickedPlayer" then
         		print(rType.value.playerserverid)
         		print(rType.value.reason)
         	end
         	if rType.data == "apikey" then
         		print(rType.value)
         	end
         	if rType.data == "tableUpdate" then
         		print(rType.value.account)
         		print(rType.value.pass)
         		print(rType.value.apikey)
         		print(rType.value.primarykey)
         		print(rType.value.fieldname)
         		print(rType.value.value)
         		print(rType.value.table)
         		print(rType.value.primarykeydata)
         	end
         	if rType.data == "createPage" then
         		print(rType.value.pagename)
         		print(rType.value.tablename)
         		print(rType.value.primarykey)
         		print(rType.value.columun)
         	end
         	if rType.data == "deletePage" then
         		print(rType.value)
         	end
         	if rType.data == "additemtoplayer" then
         		print(rType.value.playerserverid)
         		print(rType.value.itemname)
         		print(rType.value.itemcount)
         		print(rType.value.isItemWasAdded)
         	end
         	if rType.data == "addmoneytoplayer" then
         		print(rType.value.playerserverid)
         		print(rType.value.money)
         		print(rType.value.isMoneyWasAdded)
         	end
         	if rType.data == "setfullhp" then
         		print("Healed player server id = "..tostring(rType.value))
         	end
         	if rType.data == "setPlayerCoords" then
         		print(rType.value.playerserverid)
         		local coords = rType.value.coords
         		print(coords.x, coords.y, coords.z)
         	end
         end
         ```

5\. After that you can login admin panel.&#x20;

6\. If you have any questions please contact me on discord. \
[https://dc.abdulkadiraktas.com.tr ](https://dc.abdulkadiraktas.com.tr)

7\. Check more information from youtube channel.&#x20;

{% embed url="<https://www.youtube.com/channel/UCBjZfeaYXWpT_vOxheQZ86A>" %}
