scratcher911 Posted July 24, 2012 Share Posted July 24, 2012 function loadAccounts () local serial = getPlayerSerial ( source ) local result = mysql_query ( database ,"SELECT * FROM `accounts` WHERE `serial` = '"..serial.."'") if result then while true do local row = mysql_fetch_assoc(result) if not row then break end spawnPlayer( source, row.x, row.y, row.z) setElementInterior ( source, row.intterior ) setElementDimension ( source, row.demension ) setPedSkin ( source, row.skin ) setPlayerMoney ( source, row.money ) setElementHealth ( source, row.health) setPedArmor ( source, row.armor ) setPlayerWantedLevel ( source, row.wanted ) outputChatBox ('You were warped at latest position',source,255,255,255,true) break end end end addEventHandler ( "onPlayerLogin", getRootElement(), loadAccounts ) Hi. I don't own this scripts so all rights to author. Why when it spawn me i'm frozen ? Link to comment
Castillo Posted July 24, 2012 Share Posted July 24, 2012 Must be another script which freezes the player on spawn. Link to comment
scratcher911 Posted July 24, 2012 Author Share Posted July 24, 2012 nope. I don't have setElementFrozen in not even one script... Link to comment
AMARANT Posted July 24, 2012 Share Posted July 24, 2012 You can add the function to unfreeze a player into your code. Link to comment
scratcher911 Posted July 24, 2012 Author Share Posted July 24, 2012 function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) setElementData( source, "Protection", true ) setElementAlpha( source, 125 ) setTimer( function() setElementData( source, "Protection", false ) setElementAlpha( source, 255 ) end , 1000, 1) end addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) why is source nil ? Link to comment
Castillo Posted July 24, 2012 Share Posted July 24, 2012 function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) setElementData( source, "Protection", true ) setElementAlpha( source, 125 ) setTimer ( function ( player ) if ( player ) then setElementData ( player, "Protection", false ) setElementAlpha ( player, 255 ) end end ,1000, 1, source ) end addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) Link to comment
scratcher911 Posted July 24, 2012 Author Share Posted July 24, 2012 1 question more. Is there any website or wiki where I can find Query handlers ? Link to comment
Castillo Posted July 24, 2012 Share Posted July 24, 2012 What do you mean by query handlers? you mean MySQL functions? if so, then here's Ryden's module functions: https://wiki.multitheftauto.com/wiki/Mysql And this ones are the MTA built-on MySQL functions: dbConnect dbExec dbQuery dbPoll dbFree Link to comment
scratcher911 Posted July 24, 2012 Author Share Posted July 24, 2012 first one . Thanks Link to comment
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