scratcher911 Posted July 24, 2012 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 ?
Castillo Posted July 24, 2012 Posted July 24, 2012 Must be another script which freezes the player on spawn. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
scratcher911 Posted July 24, 2012 Author Posted July 24, 2012 nope. I don't have setElementFrozen in not even one script...
AMARANT Posted July 24, 2012 Posted July 24, 2012 You can add the function to unfreeze a player into your code.
scratcher911 Posted July 24, 2012 Author 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 ?
Castillo Posted July 24, 2012 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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted July 24, 2012 Posted July 24, 2012 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
scratcher911 Posted July 24, 2012 Author Posted July 24, 2012 1 question more. Is there any website or wiki where I can find Query handlers ?
Castillo Posted July 24, 2012 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 San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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