3B00DG4MER Posted August 12, 2014 Posted August 12, 2014 Hi Guys, i'm Making a gamemode which it's RPG ....... i've problem onClientPlayerQuit i tried to make if player Quit then Save the Last position With Mysql here is Client: function playerQuit() local PosX,PosY,PosZ = getElementPosition(source) triggerServerEvent("onClientLogout", localPlayer,PosX,PosY,PosZ) end addEventHandler("onClientPlayerQuit", getRootElement(),playerQuit) and Here is Server: function quitPlayer( PosX,PosY,PosZ ) local id = getElementData(source,"id") local query = dbExec(connection, "UPDATE `??` SET `??` = '??' AND `??` = '??' AND `??` = '??' WHERE `??` = '??' LIMIT 1","accounts","PosX",PosX,"PosY",PosY,"PosZ",PosZ,"id",id) end addEvent("onClientLogout",true) addEventHandler ( "onClientLogout", getRootElement(), quitPlayer ) SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
3B00DG4MER Posted August 12, 2014 Author Posted August 12, 2014 And whats the problem? it's don't update !!!!!!!!!!!! and there is nothing in debugscript, that's the problem !!!!! SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
Et-win Posted August 12, 2014 Posted August 12, 2014 local id = getElementData(source,"id") The player left, so you can't do this. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
3B00DG4MER Posted August 12, 2014 Author Posted August 12, 2014 local id = getElementData(source,"id") The player left, so you can't do this. i used this on another fuction setElementData(source,"id",row['id']) so what i can do ??? SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
Et-win Posted August 12, 2014 Posted August 12, 2014 Do that code (getElementData) in the 'playerQuit' function and send it withing the trigger. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
3B00DG4MER Posted August 12, 2014 Author Posted August 12, 2014 Do that code (getElementData) in the 'playerQuit' function and send it withing the trigger. i tried dat client: function playerQuit() local id = getElementData(source,"id") local PosX,PosY,PosZ = getElementPosition(source) triggerServerEvent("onUserLogout", source,PosX,PosY,PosZ,id) end addEventHandler("onClientPlayerQuit", getRootElement(),playerQuit) server: function quitPlayer( PosX,PosY,PosZ,id ) local query = dbExec(connection, "UPDATE `??` SET `??` = '??' AND `??` = '??' AND `??` = '??' WHERE `??` = '??' LIMIT 1","accounts","PosX",PosX,"PosY",PosY,"PosZ",PosZ,"id",id) end addEvent("onUserLogout",true) addEventHandler ( "onUserLogout", getRootElement(), quitPlayer ) SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
Et-win Posted August 12, 2014 Posted August 12, 2014 Then or: It can't or: It's server-side, but I don't know what since I have no idea how db-codes work yet. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
3B00DG4MER Posted August 12, 2014 Author Posted August 12, 2014 Ty For ur HElp i fixed it i was problem with DB codes i used 'AND' instead ',' SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now