Jump to content

WhoAmI

Members
  • Posts

    1,248
  • Joined

  • Last visited

Everything posted by WhoAmI

  1. Normally size of this font is about 13 px. So ( 13 + 2 ) * n 2 is for break behind lines n is number of lines.
  2. WhoAmI

    callRemote

    Fixed. It was problem with my VPS.
  3. WhoAmI

    callRemote

    Well, I fixed it and I use callRemote. I made mistake in spelling the word, my bad. Now I have this code <?php include ( "mta_sdk.php" ); $i = mta::getInput ( ); $subject = $i[0]; $email = $i[2]; $message = $i[3]; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= $i[1] . "\r\n"; $mailSent = mail ( $email, $subject, $message, $headers ); if ($mailSent) { mta::doReturn ( "true" ); } else { mta::doReturn ( "false" ); } It's not ERROR this time. It returns "false". I checked what $email, $subject, $message, $headers return and they return correct values. Any advice from pros?
  4. WhoAmI

    callRemote

    Anyway, it outputs error event if I'm using your code. Maybe problem is that I'm using callRemote in localhost server?
  5. WhoAmI

    callRemote

    No, I wanted to do return in this function. If email was sent succesfuly it outputs true, if not false.
  6. WhoAmI

    callRemote

    Yea, I'm sure it is.
  7. WhoAmI

    callRemote

    Hello. I'm using something like this: function sendEmail ( bool, subject, sendto, message ) outputChatBox ( tostring ( bool ) ); if ( bool == "true" ) then outputChatBox ( "test1" ); return true; elseif ( bool == "false" ) then return false; end if ( not bool ) then local header = "From: " .. subject .. " <" .. globalEmail .. ">"; local call = callRemote ( ***, sendEmail, subject, header, sendto, message ); outputChatBox ( tostring ( call ) ); end end And it returns me ERROR all the time. I'm 100% sure that PHP file is correct. Because I even changed it to: <?php include ( "mta_sdk.php" ); $i = mta::getInput ( ); mta::doReturn ( "test" ); ?> And it still outputs "ERROR", no matter what. Also when I go to url which i gave to callRemote function it shows me ["test"], so website works fine. callRemote function returns true. What can be a problem?
  8. Update graphic drivers and directx if possible.
  9. Hm. It's probably something attached to render event. Some not optimized function is going through each frame.
  10. Don't know if you can check it on performencebrowser but you can try.
  11. Get timer left time -> kill timer -> trigger left time -> create timer
  12. Get timer's left time before triggering, stop the timer, trigger the time left and start timer client-side.
  13. It doesn't matter on which OS you will run it. Any errors in /debugscript 3?
  14. So you made the rob system, didn't test it and you uploaded it to everyone? Okay.
  15. WhoAmI

    Vehicle window

    Explain a bit more, lol.
  16. WhoAmI

    On playSound

    Well, you can also open script using fileOpen and find something about playSound. Nevermind, I combine too much.
  17. WhoAmI

    On playSound

    Oh, you are right. If so: addEventHandler ( "onResourceStart", root, function ( resource ) if ( resource:getInfo ( "type" ) ~= "map" ) then return; end local resourceName = resource:getName ( ); local meta = XML.load ( ":" .. resourceName .. "/meta.xml" ); if ( meta ) then resource:stop ( ); local child = meta:getChildren ( ); if ( child ) then for _, node in pairs ( child ) do if ( node:getName ( ) == "file" ) then local song = node:getAttribute ( "src" ); if ( song:find ( ".mp3" ) or song:find ( ".wav" ) ) then node:setAttribute ( "download", "false" ); end elseif ( node:getName ( ) == "script" ) then local s = node:getAttribute ( "src" ); if ( s:find ( ".lua" ) ) then node:setAttribute ( "download", "false" ); end end end meta:saveFile ( ); meta:unload ( ); end resource:start ( ); end end ); Not sure if this will work, but you can try
  18. Well, I'm not sure Dimos7 if it work. I also made my version of it. Didn't test. function getPlayerFromID ( id ) return call ( getResourceFromName ( "game_id" ), "getPlayerFromID", tonumber ( id ) ); end function getPlayerID ( player ) return getElementData ( player, "id" ); end duelTable = { }; fightPlace = { x, y, z, interior, dimension }; function tpToFightPlace ( element ) setElementPosition ( element, fightPlace[1], fightPlace[2], fightPlace[3] ); setElementInterior ( element, fightPlace[4] ); setElementDimension ( element, fightPlace[5] ); giveWeapon ( element, 26 ); giveWeapon ( element, 24 ); giveWeapon ( element, 28 ); giveWeapon ( element, 31 ); end function duel ( player, cmd, arg ) if ( tonumber ( arg ) ) then local p = getPlayerFromID ( id ); if ( isElement ( p ) ) then if ( not duelTable [ p ] ) then duelTable [ p ] = player; outputChatBox ( "You sent invite to " .. getPlayerName ( p ) .. "!", player, 255, 255, 255, true ) else outputChatBox ( "This player is already challanged!", player, 255, 0, 0, true ); end else outputChatBox ( "Unable to find player with this ID!", player, 255, 0, 0, true ); end end if ( arg == "accept" ) then local p = duelTable [ player ]; if ( isElement ( p ) ) then outputChatBox ( "The player " .. getPlayerName ( player ) .. " (ID:" .. getPlayerID ( player ) .. ") was challanged by " .. getPlayerName ( p ) .. " (ID:" .. getPlayerID ( p ) .. ")", root, 255, 255, 255, true ); tpToFightPlace ( p ); tpToFightPlace ( player ); duelTable [ player ] = nil; else outputChatBox ( "Noone challanged you!", player, 255, 0, 0, true ); end elseif ( arg == "decline" ) then local p = duelTable [ player ]; if ( isElement ( p ) ) then duelTable [ player ] = nil; outputChatBox ( getPlayerName ( player ) .. " declined.", p, 255, 0, 0, true ); end else return; end end addCommandHandler ( "duel", duel );
  19. WhoAmI

    On playSound

    I did something like that. When map is started - it stops it, edits meta and starts again. addEventHandler ( "onResourceStart", root, function ( resource ) if ( resource:getInfo ( "type" ) ~= "map" ) then return; end local resourceName = resource:getName ( ); local meta = XML.load ( ":" .. resourceName .. "/meta.xml" ); if ( meta ) then resource:stop ( ); local child = meta:getChildren ( ); if ( child ) then for _, node in pairs ( child ) do if ( node:getName ( ) == "file" ) then local song = node:getAttribute ( "src" ); if ( song:find ( ".mp3" ) or song:find ( ".wav" ) ) then node:setAttribute ( "download", "false" ); meta:saveFile ( ); meta:unload ( ); break; end end end end resource:start ( ); end end ); I didn't test it. Script needs admin privileges.
  20. WhoAmI

    On playSound

    But it doesn't matter, you can't start 1600 maps in the same time.
  21. WhoAmI

    On playSound

    Maybe wait for tip from other pro scripter. Maybe there is a way... Don't know.
  22. WhoAmI

    On playSound

    Damn, I don't know if there is possibility to unpack .zip in MTA.
  23. I'm from Poland and I'm not even surprised. Our MTA scene is so, so big. We got really good scripters, too. Damn. I'm getting smile in my face when I see such many players on polish server.
  24. WhoAmI

    On playSound

    toni, try to use Sasu code. It should work.
  25. WhoAmI

    On playSound

    What the... Al7wsH, why wouldn't you use 'for' statement, which in this case is better imo?
×
×
  • Create New...