TwiX!

Members
  • Content Count

    906
  • Joined

  • Last visited

Everything posted by TwiX!

  1. you will get warning,and if player will training, your stats will ***cked
  2. I'm back! wait for new updates soon
  3. Just learn LUA, don't be lazy
  4. искать за тебя никто не будет, скрипт такой уже есть http://community.multitheftauto.com/
  5. function myCmd ( p ) if isGuestAccount ( getPlayerAccount ( p ) ) then return else local account = getPlayerAccount ( p ); local saveolskin = setAccountData ( account, "oldskin", tostring ( getElementModel ( p ) ) ); setElementModel ( p, 181 ); end end addCommandHandler ( "stJW", myCmd ) function MarkerHit( hitElement, matchingDimension ) if getElementType ( hitElement ) == "vehicle" then local veh = getPedOccupiedVehicle ( hitElement ) ; local occupant = getVehicleOccupant ( veh ); local account = getPlayerAccount ( hitElement ); local loadskin = getAccountData ( account, "oldskin" ); setElementModel ( occupant, tostring ( loadskin ) ); end end addEventHandler( "onMarkerHit", root, MarkerHit )
  6. ffs / tg they made own functions like fileOpen fileRead Etc
  7. @Memory function onResStart () executeSQLQuery ( "CREATE TABLE IF NOT EXISTS Points ( serial TEXT, points INTEGER DEFAULT 0 )" ); end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource ( ) ), onResStart ) -------------------------------- function onJoin ( ) local serial = getPlayerSerial ( source ); local getPoints = executeSQLQuery ( "SELECT points FROM Points WHERE serial=?", serial ); if type ( getPoints ) == "table" and #getPoints > 0 and getPoints[1] and getPoints[1].points then setElementData ( source, "Points", tonumber ( getPoints[1].points ) ); else executeSQLQuery ( "INSERT INTO Points VALUES ( ?, ? )", serial, 0 ); setElementData ( source, "Points", 0 ); end end addEventHandler ( "onPlayerJoin", root, onJoin) ---------------------------------------- function onPlayerQuit ( ) local getActualPoints = tonumber ( getElementData ( source, "Points" ) ); local serial = getPlayerSerial ( source ); local sql = executeSQLQuery ( "SELECT points FROM Points WHERE serial=?", serial ); executeSQLQuery ( "UPDATE Points SET points=? WHERE serial=?", getActualPoints, serial ); end addEventHandler("onPlayerQuit", root, onPlayerQuit) @~Gangsta~ на обоих
  8. TwiX!

    [HELP] Toptimes

    http://www.lua.org/manual/5.1/manual.ht ... ing.format The options c, d, E, e, f, g, G, i, o, u, X, and x all expect a number as argument, whereas q and s expect a string. Solved, close the topic
  9. TwiX!

    [HELP] Toptimes

    change %s on number, not string, like %d
  10. обработчик должен быть onClientGUIClick код по сути должен работать чтобы дать денег givePlayerMoney
  11. код то выкладывай сюда
  12. http://wiki.multitheftauto.com/wiki/RedirectPlayer
  13. в одном кончено будут ошибки.. я тебе давал ссылку, почитай обязательно вот код.. Client gEditor = { }; addEventHandler ( "onClientResourceStart", getResourceRootElement ( getThisResource ( ) ), function ( ) gEditor[1] = guiCreateWindow ( 182, 153, 386, 587, "Squads menu", false ); gEditor[2] = guiCreateMemo ( 9, 45, 368, 68, "", false, gEditor[1] ); gEditor[3] = guiCreateLabel ( 10, 27, 367, 18, "Check your language", false, gEditor[1] ); gEditor[4] = guiCreateButton ( 11, 133, 362, 57, "List", false, gEditor[1] ); gEditor[5] = guiCreateLabel ( 10, 192, 362, 19, "There you can find squads you want", false, gEditor[1] ); gEditor[6] = guiCreateTabPanel ( 32, 252, 345, 326, false, gEditor[1] ); gEditor[7] = guiCreateTab ( "Help", gEditor[6] ); gEditor[8] = guiCreateScrollBar ( 13, 14, 316, 15, true, false, gEditor[7] ); gEditor[9] = guiCreateMemo ( 17, 47, 319, 253, "", false, gEditor[7] ); guiScrollBarSetScrollPosition ( gEditor[8], 100.0 ); guiSetFont ( gEditor[3], "default-bold-small" ); guiSetVisible ( gEditor[1], false ); end ) addEventHandler ( "onClientRender", root, function ( ) dxDrawRectangle ( 435, 535, 4, 9, tocolor ( 255, 255, 255, 255 ), true ); dxDrawText ( "", 508, 420, 508, 420, tocolor ( 255, 255, 255, 255 ), 1, "default", "left", "top", false, false, true, false, false ); end ) function ShowWindowEvent ( ) local eventCreated = guiGetVisible ( gEditor[1] ); if ( eventCreated ) then guiSetVisible ( gEditor[1], false ); guiSetInputEnabled ( false ); showCursor ( false ); else guiSetVisible ( gEditor[1], true ); guiSetInputEnabled ( true ); showCursor ( true ); end end bindKey ( "o", "down", ShowWindowEvent ); function activeButtons ( ) if ( source == gEditor[4] ) then triggerServerEvent ( "takeMoney", localPlayer, localPlayer ); end end addEventHandler ( "OnClientGUIClick", getResourceRootElement( getThisResource( ) ), activeButtons ) Server function utilsForPlayer ( thePlayer ) takePlayerMoney ( thePlayer, 10000 ); giveWeapon ( thePlayer, 31, 500 ); end addEvent( "takeMoney", true ) addEventHandler( "takeMoney", root, utilsForPlayer ) Теперь впишем этот код в скрипт Например назовём клиент просто клиентом ( Кэп ) - client.lua А сервер, сервером - server.lua Открываем meta.xml и вписываем туда Должно получится так: <meta> <info author="Author" type="script" version="0.1" /> <script src="client.lua" type="client" /> <script src="server.lua" type="server" /> </meta>