Jump to content

drk

Members
  • Posts

    1,607
  • Joined

  • Last visited

Everything posted by drk

  1. Search for "NitroN Led Lights v2" on Google and you will find
  2. drk

    Jail Help

    No problem²
  3. drk

    Jail Help

    You wanna put the player in his interior again? setElementInterior ( target, 1 )
  4. drk

    C++ | Mathematic

    I don't know if I must create a new topic for this, so here we go: #include "stdafx.h" #include <Windows.h> #include <stdint.h> int main() { int nPrimo; int bPrimo = 0; printf ( "Type a number: " ); scanf_s ( "%d", &nPrimo ); for ( int i = 2; i <= nPrimo; i++ ) { if ( nPrimo%i != 0 ) { bPrimo = 1; } if ( bPrimo == 0 ) { MessageBox ( NULL, L"The number is prime!", L"Information", MB_ICONQUESTION ); return 0; } else { MessageBox ( NULL, L"The number is not prime!", L"Information", MB_ICONQUESTION ); return 1; } } } I made this ( classes exercise ), It works now, but if number is 3 it says number is not prime lol I don't know why, can someone help? I can't understand this shitty prime numbers
  5. drk

    Jail Help

    addCommandHandler ( 'aj', function ( sCommand, uTarget, nTime ) if ( isStaff ( localPlayer ) ) then nTime = nTime * 60 * 1000 local target = getPlayerFromName ( uTarget ); setElementInterior ( target, 6 ); setElementPosition ( target, 265.21185302734, 77.63591003418, 1001.0390625 ); setTimer ( setElementPosition, nTime, 1, target, 268.03460693359, 77.43824005127, 1001.03906 ); outputChatBox ( 'You have been jailed!', target, 193, 13, 13 ); outputChatBox ( 'INFO: ' .. getPlayerName ( target ) .. ' has been jailed for 5 minutes by Admin.', root, 255, 0, 0 ); outputDebugString ( getPlayerName ( target ) .. ' has been jailed!' ); else outputChatBox ( 'Acess denied to the command!', localPlayer, 193, 13, 13 ); end end ) addCommandHandler ( 'auj', function ( sCommand, uTarget ) if ( isStaff ( localPlayer ) ) then local target = getPlayerFromName ( uTarget ); setElementInterior ( target, 6 ); setElementPosition ( target, 268.03460693359, 77.43824005127, 1001.03906 ); outputChatBox ( 'You have been unjailed!', target, 193, 13, 13 ); else outputChatBox ( 'Acess denied to the command!', localPlayer, 193, 13, 13 ) end end ) isStaff = function ( uPlayer ) if ( getTeamName ( getPlayerTeam ( uPlayer ) ) == getTeamFromName ( 'Staff' ) ) then return true; else return false; end end Here. You got a lot of errors in the code: You used localPlayer to get team in "isStaff" function and you haven't used player parameter instead ( that's why you get Acess denied ). You forgot somethings in the outputChatBox too. I added a thing in your code. Type /aj You can easily remove if you don't want: Just remove nTime parameter, nTime declaration and change time parameter in setTimer to the time you want.
  6. drk

    Jail Help

    Wait Wafamade, I found another bugs on his code. I'm recreating it.
  7. drk

    Jail Help

    function jailBastard(commandName, jailTar) local Bastard = getPlayerFromName(jailTarget) if isStaff(localPlayer) then local Bastardz = getPlayerName(jailTar) setElementInterior ( Bastard, 6 ) setElementPosition (Bastard, 265.21185302734, 77.63591003418, 1001.0390625) setTimer ( setElementPosition, 300000, 1, Bastard, 268.03460693359, 77.43824005127, 1001.03906) outputChatBox ( "You have been jailed !", theNoob, 193, 13, 13 ) outputChatBox ( INFO: getPlayerName(theNoob).." has been jailed for 5 minutes by Admin.", getRootElement(), 255, 0, 0 ) outputDebugString ( getPlayerName(theNoob).." has been jailed !" ) else outputChatBox ("Access denied", localPlayer, 193, 13, 13) end end function unJail (commandName, jailTar) local Bastard = getPlayerFromName(jailTarget) if isStaff(localPlayer) then setElementInterior ( Bastard, 6) setElementPosition ( Bastard, 268.03460693359, 77.43824005127, 1001.03906) outputChatBox ("You have been unjailed !", theNoob, 193, 13, 13) else outputChatBox ("Access denied !", localPlayer, 193, 13, 13) end end addCommandHandler("aj", jailBastard ) addCommandHandler("auj", unJail ) isStaff = function ( uPlayer ) if ( getTeamName ( getPlayerTeam ( uPlayer ) ) == getTeamFromName ( 'Staff' ) ) then return true; end end
  8. drk

    What s problem

    Will never work because you're triggering an event for the started resource.
  9. I never seen any Sandking mod. Are you talking about his wheels / lights?
  10. I have it. Here: http://www.mediafire.com/?pznxz2u8293p5j6
  11. Go ahead and create with XML and you will know what I'm saying
  12. drk

    Login.

    Seems like you don't get data from table for 5 minutes.
  13. drk

    GAMEMODE help

    But... myonlake, he put. name="return to 90's detroit"
  14. drk

    GAMEMODE help

    Use setGameType to change your gamemode name.
  15. drk

    Login.

    I don't know where is that "Bad login or pass" errors, so I can't help you.
  16. drk

    Login.

    Client-side: function createLoginBox() LoginGUI = guiCreateWindow(527,159,380,407,"Truck - Logowanie",false) guiSetAlpha(LoginGUI,0.69999998807907) guiWindowSetSizable(LoginGUI,false) IntroLabel = guiCreateLabel(47,62,290,32," Witamy na Truck!\nWpisz poniżej Login oraz Hasło, aby się zalogować!",false,LoginGUI) guiSetFont(IntroLabel,"default-bold-small") LoginLabel = guiCreateLabel(76,181,38,16,"Login:",false,LoginGUI) guiSetFont(LoginLabel,"default-bold-small") PassLabel = guiCreateLabel(72,218,40,16,"Hasło:",false,LoginGUI) guiSetFont(PassLabel,"default-bold-small") LoginBox = guiCreateEdit(128,179,137,19,"",false,LoginGUI) PassBox = guiCreateEdit(129,216,137,19,"",false,LoginGUI) guiEditSetMasked(PassBox,true) LoginButton = guiCreateButton(35,259,306,52,"Zaloguj!",false,LoginGUI) RegisterButton = guiCreateButton(35,330,306,52,"Zarejesrtuj!",false,LoginGUI) guiSetVisible(LoginGUI, false) addEventHandler("onClientGUIClick", LoginButton, submitLogin, false) addEventHandler("onClientGUIClick", RegisterButton, registerPlayer, false) end function startLoginRegisterModule() createLoginBox() if (LoginGUI ~= nil) then guiSetVisible(LoginGUI, true) else outputDebugString("Nie moge utworzyc GUI odpowiedzialnego od Logowania/Rejestracji!", 3, 255, 0, 0) end showCursor(true) guiSetInputEnabled(true) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), startLoginRegisterModule) function submitLogin(button, state) if button == "left" and state == "up" then local login = guiGetText(LoginBox) local pass = guiGetText(PassBox) if login and pass then triggerServerEvent("submitLoginServer", getRootElement(), login, pass) guiSetInputEnabled(false) guiSetVisible(LoginGUI, false) showCursor(false) else outputChatBox("#EE5555* #C0C0C0Proszę wpisać #EE5555Login #C0C0C0i #EE5555Hasło#C0C0C0!") end end end Server-side: function loginHandler(login, pass) mysql = dbConnect("mysql", "dbname=mta;host=192.166.219.226", "damiano", "Censored", "share=1") if(mysql) then outputServerLog("\n[MySQL] Pomyslnie polaczono z MySQL!") outputDebugString("Pomyslnie polaczono z MySQL!", 3, 0, 224, 0) else outputServerLog("\n[MySQL] Wystapil blad podczas laczenia z MySQL! Polaczenie zostalo zerwane...") outputDebugString("Wystapil blad podczas laczenia z MySQL! Polaczenie zostalo zerwane...", 3, 255, 0, 0) destroyElement(mysql) end local acc = dbQuery(mysql, "SELECT * FROM `accounts` WHERE `account` = `%s` AND `password` = `%s`", login, pass) local result = dbPoll(acc, 0) if result then if client then spawnPlayer(client, 1959.55, -1714.46, 10) fadeCamera(client, true) setCameraTarget(client, client) end else outputChatBox("#EE5555* #C0C0C0Podano zły #EE5555Login #C0C0C0lub #EE5555Hasło#C0C0C0!") end end addEvent("submitLoginServer", true) addEventHandler("submitLoginServer", root, loginHandler)
  17. How much are you willing to pay? Tell us, dude.
  18. drk

    Login.

    Also, you can't use variables with same name of MTA:SA functions like getAccount.
  19. drk

    carfade issue

    I don't know, are the elements in the player? You can see race mode's code and try to view where is that.
  20. drk

    carfade issue

    You can use setVehicleLightState to set vehicle lights off. https://wiki.multitheftauto.com/wiki/Set ... LightState
  21. drk

    C++ | Mathematic

    Also you need better read documentation about c++ I'm already learning C++ from a book I bought and It has much exercises and these things but don't explain somethings.
  22. drk

    C++ | Mathematic

    k Thanks, I understand now.
  23. drk

    Colored TopTimes

    If you need help, I'm here.
  24. drk

    C++ | Mathematic

    Okay. Thanks, now can someone explain me in this code: void main() { int i, j, k; printf ( "\n" ); for ( k = 0; k <= 1; k++ ) { printf ( "\n" ); for ( i = 1; i < 5; i++ ) printf ( "Tabuada do %3d ", i + 4 * k + 1 ); printf ( "\n" ); for ( i = 1; i <= 9; i++ ) { for ( j = 2 + 4 * k; j <= 5 + 4 * k; j++ ) printf ( "%3d x%3d = %3d ", j, i, j * i ); printf ( "\n" ); } } } Why just in 2 for loops it's needed keys { } ?
×
×
  • Create New...