-
Posts
1,255 -
Joined
-
Last visited
Everything posted by .:HyPeX:.
-
Hello everyone, i've been searching throught every script in the race gamemode, and i cant find anywhere where this is being done (The "Waiting for other Players..") Does anybody know? Greetz HyPeX Image:
-
Do you have the script owner's permission to use it and edit it?
-
Can I use a function declared in fileA.lua in the fileB.lua?
.:HyPeX:. replied to Stanley Sathler's topic in Scripting
If they are both server/client sided (Same), theorically yes, becouse they are being defined globally. Idk if there's any difference by calling the function g_functionName. Thought i usually do that for this purpouse. Test it thought. (Remember one file may load before the other, so add a timer.) Oh and you did a syntax error // file: fileB.lua function anyFunction() outputChatBox("Number: " + myFunction()) end -
Saw some loong time ago a speedometer wich actually showed the gear you were at, and you couldnt continue accelerating if you didnt geared up. Couldnt find any function/event related to this, is there any? Greetz HyPeX
-
Global variable, defined in the previous function, on map start.
-
Oh... thanks! Didnt saw that... <info gamemodes="race" type="map" name="[DM] CooN Vol4 - Peaceful Finale" author="A black person" version="1.0.0" description="This is my first handmade map and also my last solo map, enjoy! - A black person"></info> By the way, i'm doing something wrong? i never get the outputChatBox addEvent("onPlayerPickUpRacePickup", true) addEventHandler("onPlayerPickUpRacePickup",root,function(id, type, veh) if veh == 425 then local serial = getPlayerSerial(source) local name = getPlayerName(source) local time = exports.race:getTimePassed() local country = exports.admin:getPlayerCountry(source) addNewTime(currentRes,serial,time,name,country) outputChatBox("Player "..name.." got a toptime "..time.. " country "..country, root, 255,255,255,true) end end)
-
Simply its not working.. addEventHandler("onResourceStart", root, function(res) CheckPossibleMap(res) end) function CheckPossibleMap(res) local ResType = getResourceInfo(res, "type") outputChatBox(ResType) if ResType == "map" then local ResMode = getResourceInfo(res,"gamemode") outputChatBox(ResMode) if ResMode == "race" then local Name = getResourceInfo(res, "name") outputChatBox(Name) if Name then if not g_TopTimesDatabase[getResourceName(res)] then g_TopTimesDatabase[getResourceName(res)] = {} g_TopTimesDatabase[getResourceName(res)].name = Name g_TopTimesDatabase[getResourceName(res)].author = getResourceInfo(res,"author") g_TopTimesDatabase[getResourceName(res)].date = getRealTime().timestamp g_TopTimesDatabase[getResourceName(res)].playcount = 1 g_TopTimesDatabase[getResourceName(res)].huntercount = 0 g_TopTimesDatabase[getResourceName(res)].likes = 0 g_TopTimesDatabase[getResourceName(res)].toptimes = {} currentRes = res outputChatBox("Toptimes: Map".. Name.. " Loaded!", root, 255,255,255,true) else g_TopTimesDatabase[getResourceName(res)].playcount = g_TopTimesDatabase[getResourceName(res)].playcount + 1 currentRes = res outputChatBox("Toptimes: Map".. Name.. " Loaded!", root, 255,255,255,true) end end end end end
-
Pretty much a login panel
-
By the way, its one in the chamber. Chamber == bullter mag.
-
Well.. its kinda funny: function CheckPossibleMap(res) local ResType = getResourceInfo(res, "type") outputChatBox(ResType) if ResType == "map" then local ResMode = getResourceInfo(res,"gamemode") outputChatBox(ResMode) if ResMode == "race" then local Name = getResourceInfo(res, "name") outputChatBox(Name) chatbox: Map '[DM] CooN Vol4 - Peaceful Finale' started. map Notice: Collisions are turned off for this map Not sure why the rest isnt being done... EDIT: Wrong forum, can someone please move this to scripting? Thanks! EDIT2: Thanks for moving!
-
Not really, i dont know php at all so idk what to do here...
-
Okay, so now i got a problem, i could get to advance a little bit, searching arround: http://www.invisionpower.com/support/gu ... odules-r42 But, i got a problem, it is not working as it should. http://www.emp-clan.eu/hypexlogin.php This is the php code <?php require( "initdata.php"); require( "hypexmta/sdk/mta_sdk.php" ); require( "admin/sources/base/ipsRegistry.php" ); require( "admin/sources/loginauth/login_core.php" ); require( "admin/sources/loginauth/interface_login.php" ); ipsRegistry::init(); $table = mta::getInput(); $text = $table[1]; if(isset($text)){ $returning = authenticate("hypex", "", "atrevidos"); mta::doReturn($returning); } class login_test extends login_core implements interface_login { /** * Properties passed from database entry for this method * * @param array */ protected $method_config = array(); /** * Properties passed from conf.php for this method * * @param array */ protected $external_conf = array(); /** * Constructor * * @param object ipsRegistry object * @param array DB entry array * @param array conf.php array * @return void */ public function __construct( ipsRegistry $registry, $method, $conf=array() ) { $this->method_config = $method; $this->external_conf = $conf; parent::__construct( $registry ); } /** * Authenticate the member against your own system * * @param string Username * @param string Email Address * @param string Plain text password entered from log in form * @return bool */ public function authenticate( $username, $email_address, $password ) { /* Depending on your type of auth, username or email address will be blank For this example, we'll only accept email address log in and this will be set from the Admin CP.*/ /* We assume that myDB is a static class that interfaces with your own database systems */ $member = myDB::query("select id, userName, emailAddress from myMembers where emailAddress='$email_address'"); if ( ! $member['id'] ) { $this->return_code = 'NO_USER'; return false; } if ( md5( $password ) != $member['md5Password'] ) { $this->return_code = 'WRONG_AUTH'; return false; } if ( $member['id'] ) { $this->return_code = 'SUCCESS'; /* We must populate $this->member_data if we find a matching user. If we do not have one, one must be created like so */ /* Test locally */ $localMember = IPSMember::load( $member['emailAddress'] ); if ( $localMember['member_id'] ) { $this->member_data = $localMember; } else { $this->member_data = $this->createLocalMember( array( 'members' => array( 'name' => $member['userName'], 'password' => $password, 'email' => $mem-ber['emailAddress'] ) ) ); } return true; } return false; } } ?> it is funny, becouse the exact code given by IPB fails to load...
-
Hello everyone i'm doing a login panel to include IPB forum. This has been over seen lots of times, and i've only got one problem. What are the IPB functions aviable? I've already readed fatalterror's tutorial and QuantumZ's tutorialonly covered how to register accounts, not how to load them, or add any data to them. I was told to use IPB's functions to all this. (I could already manage to get things working arround). If anyone was kind enought to tell me wich are the functions i'd need to do a member login, get its user ID (in the forum), and save/restore data from its account, and its arguments, i'd be totally gratefull. Greeetz
-
How so? some radians & sine/cousine?
-
Hello, how can i get an easing function with the green line parameters? For a screen animation, if i'd use linear or most of them, it would be a straight line between these 2 points, but i need a way to do this... is there any, or i need to get multiple points in its trajectory?, like black line, but in a more repetitive way. http://imgur.com/ILz4urG Greetz
-
Gosh you copied my code directly, didnt you look at how it works? anyone would realize instantly that it wont update anything else than the source.. If you cant do anything with this code, simply start learning yourself and stop wasting our time with no work from your side. local serials = {} function onPlayerJoin() local serial = getPlayerSerial(source) if serials[serial] then else serials[serial] = serial end for i,source in ipairs(getElementsByType("player")) do setElementData(source, "uniqueHits", CountHits) end addEventHandler("onPlayerJoin",root,onPlayerJoin) function CountHits() local hits = table.size(serials) return hits end function onResourceStart() local file = fileOpen("pc.txt") if file then size = fileGetSize(file) local buffer = fileRead(file,size) local serials = fromJSON(buffer) fileClose(file) end end addEventHandler("onResourceStart", resourceRoot, onResourceStart) function onResourceStop() local file = fileCreate("pc.txt") fileWrite(file, toJSON(serials)) fileClose(file) end addEventHandler("onResourceStop", resourceRoot, onResourceStop) function table.size(tab) local length = 0 for _ in pairs(tab) do length = length + 1 end return length end
-
i belive you cannot use more than 1 and per if statement. 2 and i belive its not going to work.
-
Change default animation from slothbot when they're chasing
.:HyPeX:. replied to Stanley Sathler's topic in Scripting
Try to set the walking style on every movement action on the clientside, that might work. -
i did a full Dx work lastly, including custom dx input methods instead of guiEdits. All i can say dx was way abdove anything i could've done with CEGUI. Only bad part is the time i took doing it, took a whole 2 days of work. CEGUI would've been half day at max.
-
Seriously, how hard can this be?! Server local serials = {} function onPlayerJoin() local serial = getPlayerSerial(source) if serials[serial] then else serials[serial] = serial end setElementData(source, "uniqueHits", CountHits) addEventHandler("onPlayerJoin",root,onPlayerJoin) function CountHits() local hits = 0 for i,v in pairs(serials) do hits = hits + 1 end return hits end function onResourceStart() local file = fileOpen("pc.txt") if file then size = fileGetSize(file) local buffer = fileRead(file,size) local serials = fromJSON(buffer) fileClose(file) end end addEventHandler("onResourceStart", resourceRoot, onResourceStart) function onResourceStop() local file = fileCreate("pc.txt") fileWrite(file, toJSON(serials)) fileClose(file) end addEventHandler("onResourceStop", resourceRoot, onResourceStop) Client local uniqueHits = getElementData(getLocalPlayer(), "uniqueHits")
-
onClientKey dxDrawRectangle interpolateBetween
-
For me worked on, 2.5 ghz( my laptop's ).. But still might be different for others.. and why is the computer speed need to be so good? You 2 guys, please erease yourselves from the forum... Like IYAMA said, you need to test, even 1GHZ may be enought if the server load is enought low. Oh and to mention, GHZ is no real parameter alone, do some background research on the processors itself, the transitor ammout is the other big part of the meal. A good examle of this is the 2GHz Quad my LG G2 phone has, is not even close to a 10year old 1GHZ dual core PC CPU. (Okay, maybe not that exteme, but yeah.) To do some short explanation (unnacurate, but useful):
-
Note: string.split and table.size are usefull functions local text "My Random generated string of text wich goes long" local str = string.split(text) local mstr = "" local boxStart = x*0.2 local cursorPosition = x*0.3 for i=1, table.size(str) do mstr = mstr..str[i] if cursorPosition <= dxGetTextWidth(mstr, scale, font) + boxStart then -- Found da spot! end end You'd still need to do some maths to where to add more characters due to the nature of dxInput, but you can do it from here
