Jump to content

Kapupc

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by Kapupc

  1. Eth, thanks to you i found something wrong with skin id because default value did i set is 3 that invalid skin and make it fail now edit to another skin work find 10 hour for god shake
  2. here is result from log everything fine but ped doesn't spawn [2014-12-22 20:21:46] INFO: Jayz_Chou login with Jayz_Chou account. [2014-12-22 20:21:46] INFO: -2047.15 [2014-12-22 20:21:46] INFO: -86.17 [2014-12-22 20:21:46] INFO: 35.16 [2014-12-22 20:21:46] INFO: 0 [2014-12-22 20:21:46] INFO: 0 [2014-12-22 20:21:46] INFO: 3 [2014-12-22 20:21:46] INFO: SpawnPlayer Jayz_Chou..
  3. i just dun understand why spawnPlayer can FAIL because variable is correct like output shown
  4. spawnPlayer (source, 0,0,0,0) from you that work ! but i back to my algorithm and output the check variable is shown fine but. what can i do function tryToLogInAsClient(theLogin,thePassword) if getElementData(source, "IsLoggedIn") == false then if theLogin and thePassword then dbQuery( function(qh, thePlayer) local result = dbPoll( qh, 0 ) if #result == 1 then setTimer(triggerClientEvent, 2000, 1, thePlayer,"onClientSuccessfullyLogIn",thePlayer) displayServerMessage(thePlayer,"you are logged in") local preData = { ID = tonumber(result[1].id), name = result[1].name, adminlevel = tonumber(result[1].adminlevel), level = tonumber(result[1].level), faction = tonumber(result[1].faction), skinid = tonumber(result[1].skinid), money = tonumber(result[1].money) } playerData[thePlayer] = preData local currentName = getPlayerName(thePlayer) if currentName ~= playerData[thePlayer].name then setPlayerName(thePlayer, playerData[thePlayer].name) end outputDebugString(currentName.." login with "..theLogin.." account.") resetPlayerMoney(thePlayer) setPlayerToSpawn(thePlayer) if playerData[thePlayer].faction == 1 then setPlayerTeam(thePlayer, civTeam) elseif playerData[thePlayer].faction == 2 then setPlayerTeam(thePlayer, policeTeam) elseif playerData[thePlayer].faction == 3 then setPlayerTeam(thePlayer, fbiTeam) elseif playerData[thePlayer].faction == 4 then setPlayerTeam(thePlayer, marines) elseif playerData[thePlayer].faction == 5 then setPlayerTeam(thePlayer, mayorTeam) elseif playerData[thePlayer].faction == 6 then setPlayerTeam(thePlayer, reporterTeam) elseif playerData[thePlayer].faction == 7 then setPlayerTeam(thePlayer, medicTeam) elseif playerData[thePlayer].faction == 8 then setPlayerTeam(thePlayer, licenseTeam) elseif playerData[thePlayer].faction == 9 then setPlayerTeam(thePlayer, taxiTeam) elseif playerData[thePlayer].faction == 10 then setPlayerTeam(thePlayer, cluckinbellTeam) elseif playerData[thePlayer].faction == 11 then setPlayerTeam(thePlayer, vagosTeam) elseif playerData[thePlayer].faction == 12 then setPlayerTeam(thePlayer, aztecasTeam) elseif playerData[thePlayer].faction == 13 then setPlayerTeam(thePlayer, ballasTeam) elseif playerData[thePlayer].faction == 14 then setPlayerTeam(thePlayer, groovstreetTeam) elseif playerData[thePlayer].faction == 15 then setPlayerTeam(thePlayer, yakuzaTeam) elseif playerData[thePlayer].faction == 16 then setPlayerTeam(thePlayer, lcnTeam) end setElementData(thePlayer, "level", playerData[thePlayer].level) triggerClientEvent(thePlayer, "doScoreboardAddColumn", thePlayer, "level", 40, "Level", 2) triggerClientEvent(thePlayer, "startBind", thePlayer) setElementData(thePlayer, "IsLoggedIn", true) else displayServerMessage(thePlayer,"wrong password","warning") end end ,{ source }, mySQL, "SELECT * FROM players WHERE name=? AND password=? LIMIT 1", theLogin, hash("sha512", thePassword)) end end end addEvent("onClientWantToLogIn",true) addEventHandler("onClientWantToLogIn",getRootElement(),tryToLogInAsClient) function setPlayerToSpawn(thePlayer) local spX, spY, spZ, spA, spI local faction = playerData[thePlayer].faction local skin = playerData[thePlayer].skinid if faction == 1 then--civ spX = -2047.15 spY = -86.17 spZ = 35.16 spA = 0 spI = 0 elseif faction == 2 then--police spX = 246.48 spY = 121.31 spZ = 1003.22 spA = 0 spI = 10 elseif faction == 3 then--fbi spX = 268.29 spY = 185.07 spZ = 1008.17 spA = 0 spI = 3 elseif faction == 4 then--soldier spX = -1429.62 spY = 507.11 spZ = 3.03 spA = 0 spI = 0 elseif faction == 5 then--major spX = 347.82 spY = 162.06 spZ = 1025.78 spA = 0 spI = 3 elseif faction == 6 then--reporter spX = 1719.05 spY = -1658.70 spZ = 20.22 spA = 0 spI = 18 elseif faction == 7 then--medic spX = -2655.42 spY = 636.88 spZ = 14.45 spA = 0 spI = 0 elseif faction == 8 then--license spX = -2023.08 spY = -114.21 spZ = 1035.17 spA = 0 spI = 3 elseif faction == 9 then--taxi spX = -2055.33 spY = 8.61 spZ = 32.35 spA = 0 spI = 0 elseif faction == 10 then--cluckin bell spX = 377.08 spY = -8.26 spZ = 1001.85 spA = 0 spI = 9 elseif faction == 11 then--vagos spX = 2246.50 spY = -1163.21 spZ = 1029.79 spA = 0 spI = 15 elseif faction == 12 then--aztecas spX = 309.26 spY = 1123.77 spZ = 1083.88 spA = 0 spI = 5 elseif faction == 13 then--ballas spX = 2579.11 spY = -1284.45 spZ = 1065.36 spA = 0 spI = 2 elseif faction == 14 then--groov street spX = 2448.35 spY = -1705.59 spZ = 1013.5 spA = 0 spI = 2 elseif faction == 15 then--yakuza spX = -2170.28 spY = 646.60 spZ = 1057.59 spA = 0 spI = 1 elseif faction == 16 then--lcn spX = 1292.33 spY = -825.88 spZ = 1085.63 spA = 0 spI = 5 end outputDebugString( spX ) outputDebugString( spY ) outputDebugString( spZ ) outputDebugString( spA ) outputDebugString( spI ) outputDebugString( skin ) outputDebugString("SpawnPlayer "..getPlayerName(thePlayer)..".. ") spawnPlayer( thePlayer, spX, spY, spZ, spA, skin, spI) fadeCamera (thePlayer, true, 1.5) setCameraTarget (thePlayer, thePlayer) if spI ~= 0 then setPlayerHudComponentVisible ( thePlayer, "radar", false ) else setPlayerHudComponentVisible ( thePlayer, "radar", true ) end end
  5. i'm so tried because setPlayerTeam still work fine but have no idea about spawnPlayer when i logged in and camera is fade fine but my ped doesn't spawn i did try to force spawnPlayer in that line but still return false help pls function tryToLogInAsClient(theLogin,thePassword) if getElementData(source, "IsLoggedIn") == false then if theLogin and thePassword then dbQuery( function(qh, source) local result = dbPoll( qh, 0 ) if #result == 1 then setTimer(triggerClientEvent, 2000, 1, source,"onClientSuccessfullyLogIn",source) displayServerMessage(source,"you are logged in") local preData = { ID = tonumber(result[1].id), name = result[1].name, adminlevel = tonumber(result[1].adminlevel), level = tonumber(result[1].level), faction = tonumber(result[1].faction), skinid = tonumber(result[1].skinid), money = tonumber(result[1].money) } playerData[source] = preData local currentName = getPlayerName(source) if currentName ~= playerData[source].name then setPlayerName(source, playerData[source].name) end outputDebugString(currentName.." login with "..theLogin.." account.") resetPlayerMoney(source) setPlayerToSpawn(source) -- THIS LINE !! if playerData[source].faction == 1 then setPlayerTeam(source, civTeam) elseif playerData[source].faction == 2 then setPlayerTeam(source, policeTeam) elseif playerData[source].faction == 3 then setPlayerTeam(source, fbiTeam) elseif playerData[source].faction == 4 then setPlayerTeam(source, marines) elseif playerData[source].faction == 5 then setPlayerTeam(source, mayorTeam) elseif playerData[source].faction == 6 then setPlayerTeam(source, reporterTeam) elseif playerData[source].faction == 7 then setPlayerTeam(source, medicTeam) elseif playerData[source].faction == 8 then setPlayerTeam(source, licenseTeam) elseif playerData[source].faction == 9 then setPlayerTeam(source, taxiTeam) elseif playerData[source].faction == 10 then setPlayerTeam(source, cluckinbellTeam) elseif playerData[source].faction == 11 then setPlayerTeam(source, vagosTeam) elseif playerData[source].faction == 12 then setPlayerTeam(source, aztecasTeam) elseif playerData[source].faction == 13 then setPlayerTeam(source, ballasTeam) elseif playerData[source].faction == 14 then setPlayerTeam(source, groovstreetTeam) elseif playerData[source].faction == 15 then setPlayerTeam(source, yakuzaTeam) elseif playerData[source].faction == 16 then setPlayerTeam(source, lcnTeam) end setElementData(source, "level", playerData[source].level) triggerClientEvent(source, "doScoreboardAddColumn", source, "level", 40, "Level", 2) triggerClientEvent(source, "startBind", source) setElementData(source, "IsLoggedIn", true) else displayServerMessage(source,"wrong password","warning") end end ,{ source }, mySQL, "SELECT * FROM players WHERE name=? AND password=? LIMIT 1", theLogin, hash("sha512", thePassword)) end end end addEvent("onClientWantToLogIn",true) addEventHandler("onClientWantToLogIn",getRootElement(),tryToLogInAsClient) function setPlayerToSpawn(source) local spX, spY, spZ, spA, spI local faction = playerData[source].faction local skin = playerData[source].skinid if faction == 1 then--civ spX = -2047.15 spY = -86.17 spZ = 35.16 spA = 0 spI = 0 elseif faction == 2 then--police spX = 246.48 spY = 121.31 spZ = 1003.22 spA = 0 spI = 10 elseif faction == 3 then--fbi spX = 268.29 spY = 185.07 spZ = 1008.17 spA = 0 spI = 3 elseif faction == 4 then--soldier spX = -1429.62 spY = 507.11 spZ = 3.03 spA = 0 spI = 0 elseif faction == 5 then--major spX = 347.82 spY = 162.06 spZ = 1025.78 spA = 0 spI = 3 elseif faction == 6 then--reporter spX = 1719.05 spY = -1658.70 spZ = 20.22 spA = 0 spI = 18 elseif faction == 7 then--medic spX = -2655.42 spY = 636.88 spZ = 14.45 spA = 0 spI = 0 elseif faction == 8 then--license spX = -2023.08 spY = -114.21 spZ = 1035.17 spA = 0 spI = 3 elseif faction == 9 then--taxi spX = -2055.33 spY = 8.61 spZ = 32.35 spA = 0 spI = 0 elseif faction == 10 then--cluckin bell spX = 377.08 spY = -8.26 spZ = 1001.85 spA = 0 spI = 9 elseif faction == 11 then--vagos spX = 2246.50 spY = -1163.21 spZ = 1029.79 spA = 0 spI = 15 elseif faction == 12 then--aztecas spX = 309.26 spY = 1123.77 spZ = 1083.88 spA = 0 spI = 5 elseif faction == 13 then--ballas spX = 2579.11 spY = -1284.45 spZ = 1065.36 spA = 0 spI = 2 elseif faction == 14 then--groov street spX = 2448.35 spY = -1705.59 spZ = 1013.5 spA = 0 spI = 2 elseif faction == 15 then--yakuza spX = -2170.28 spY = 646.60 spZ = 1057.59 spA = 0 spI = 1 elseif faction == 16 then--lcn spX = 1292.33 spY = -825.88 spZ = 1085.63 spA = 0 spI = 5 end spawnPlayer( source, spX, spY, spZ, spA, skin, spI) fadeCamera (source, true, 1.5) setCameraTarget (source, source) if spI ~= 0 then setPlayerHudComponentVisible ( source, "radar", false ) else setPlayerHudComponentVisible ( source, "radar", true ) end end
  6. so.. how dxscoreboard can get data from server side table like money, level, exp explain pls
  7. omg bad idea, how about when i create a vehicle and save into database i take that vehicle id(indatabase) and save into player data so that play will have vehicles key to access control that vehicle wew maybe this is EASIEST way
  8. i got some idea, can i saveplayerdata with table like saveaccountdata(acc, "vehiclesdata", table) ?
  9. no one get hmm if you have 100 vehicles in vehicles database and when your change your name you need to edit 100 vehicles owner finally that look abit process but. i'm just look to better way mine tink we cant do with account system from mta i will go exthernal data base thanks every post ^__^
  10. account name still can change everytime like someone donote to change thier name in roleplay server. so if you script with unix_id that is dynamical with account name
  11. because i just wanna make dynamic vehicle owner ship so i cannot connect to internal.db and sure i cant make new table i still make another .db but and cannot get id in accounts database that's all i need because i can't check who's owner anything i don't want to check with player name because unix id is cannot change tell me pls how can i do
×
×
  • Create New...