Jump to content

SDK

Members
  • Posts

    635
  • Joined

  • Last visited

Everything posted by SDK

  1. It looks like you got most lines from here, but you're mixing server and client up. meta.xml ... <script src="login_s.lua" type="server" /> <script src="login_c.lua" type="client" /> ... login_s.lua (server): function loginHandler(username,password) handler = mysql_connect(".......", ".....", "......", ".....") if ( not handler ) then outputChatBox("Unable to connect to the MySQL server") else outputChatBox("Able to connect to the MySQL server") mysql_close(handler) end if username == "g" and password == "a" then if (source) then outputChatBox("Logged in successfully",source) spawnPlayer(source, 1959.55, -1714.46, 10) fadeCamera(source, true) setCameraTarget(source) end else outputChatBox("Invalid username and password. Please re-connect and try again.",source) end end addEvent("submitLogin",true) addEventHandler("submitLogin",root,loginHandler) login_c.lua (client) : ... -- your code when clicking the button triggerServerEvent ("submitLogin", getLocalPlayer(),username,password) ... (These files are only an example, you can use your own names and folders)
  2. Probably not, the error happens before those functions. But you still need to keep them clientside (all GUI stuff). Is everything correct in the meta.xml?
  3. Quick question, is it even possible to detect when a hunter shoots a vehicle? Afaik, it wasn't? And a small error: the outputChatBox's are wrong, you're adding exp after you already set the account data.
  4. "Doesn't work" .. Try being more specific, any errors in debug? Edit: There's a ( to much on line 3 in createVehicle, and your license plate should be a string!
  5. Use debugging... Line 8 needs more parameters. addEventHandler ( "onClientResourceStart", getResourceRootElement(), attach ) Line 11, "attach" is a function, correct element is "Marker". if isElementWithinMarker ( player, Marker) then
  6. SDK

    Serial Banned issue

    Send ccw a pm about the problem
  7. SDK

    Map Editor problem

    This may sound silly, but could you try to change the first line in your map file to this: <map edf:definitions="race,editor_main"> (For the ones interested, I think these lines 272-278 in race_server.lua cause the problem ) I haven't tried this myself, but I had the same problem as you once. It happened after I edited the map manually a bit.
  8. Only it doesn't work that way, it uses the checkpoint split times to compare. So, it's not possible to modify the progress bar for your needs.
  9. 1) https://wiki.multitheftauto.com/wiki/Resource:Race -> Events You probably need onPollStarting or onRaceStateChanging 2) https://wiki.multitheftauto.com/wiki/OnPlayerChat Read Cancel effect Good luck
  10. SDK

    Statistics System

    ok i have a question, if u dont share it why u say u made it?. in my opinion is kinda useless He explained roughly how he did it tho. In my opinion that's usefull
  11. SDK

    mapnames

    That's a setting for the race resource. Find a setting like "Show map name" in the admin panel resources and set it to true.
  12. Why would you want a 1 millisecond respawn? Since setTimer's lowest interval is 50ms, I guess it's the pickups lowest interval as well and that should be low enough.
  13. Looks nice, I would love to try it out when it's released
  14. SDK

    MTA automessages.

    I think I saw another thing at line 24 mta.text %advermsg %advermsg = %advertmsg ?
  15. SDK

    MTA automessages.

    This is how I would do it: on *:SIGNAL:mta.command: { if ($3 == !advert) { if ($mta.level($1,$2) = 5) { if ($4 == $null) mta.pm $1 $2 Error - Set an advert-Message else { mta.text $1 Advert $iif(!timer(mta.advert),changed,added) .timermta.advert 0 60 mta.text $1 $4- } } else mta.pm $1 $2 Error - You need to be level 5 to use this command } elseif ($3 == !stopadvert) { if ($mta.level($1,$2) = 5) { if ($timer(mta.advert)) { .timermta.advert off mta.text $1 Advert stopped } else mta.pm $1 $2 Error - No advert found } else mta.pm $1 $2 Error - You need to be level 5 to use this command } } I would prefer mine cause you are using a variable, your timer would never stop and your using a signal And you forgot your $1 at line 24
  16. Does $mta.dead returns the number off all dead players? Edit: And I guess you mean $mta.server ...
  17. $mta.dead returns "1" if a player is dead, else it returns nothing: on *:SIGNAL:mta.part: { if ($mta.dead($1,$2) != 1) set %cplayers $calc(%cplayers - 1) mta.end $1 $2 } Sanzor, if you can't script, then don't post ...
  18. Thats mta.adcon on *:SIGNAL:mta.adcon:{ if ($1 == %echoserverid) /msg #CHANNEL $mta.nick($1,$2) $+ : $3- } Just look here
  19. I wrote something: on *:signal:mta.join:{ if ($1 != 1) mta.text 1 <sAkina # $+ $1 $+ > $mta.nick($1,$2) has joined the game if ($1 != 2) mta.text 2 <sAkina # $+ $1 $+ > $mta.nick($1,$2) has joined the game if ($1 != 3) mta.text 3 <sAkina # $+ $1 $+ > $mta.nick($1,$2) has joined the game if ($1 != 4) mta.text 4 <sAkina # $+ $1 $+ > $mta.nick($1,$2) has joined the game } on *:signal:mta.part:{ if ($1 != 1) mta.text 1 <sAkina # $+ $1 $+ > $mta.nick($1,$2) has left the game (Reason: $iif($3 == 1,Kicked,$iif($3 == 2,Banned,Exit)) $+ ) if ($1 != 2) mta.text 2 <sAkina # $+ $1 $+ > $mta.nick($1,$2) has left the game (Reason: $iif($3 == 1,Kicked,$iif($3 == 2,Banned,Exit)) $+ ) if ($1 != 3) mta.text 3 <sAkina # $+ $1 $+ > $mta.nick($1,$2) has left the game (Reason: $iif($3 == 1,Kicked,$iif($3 == 2,Banned,Exit)) $+ ) if ($1 != 4) mta.text 4 <sAkina # $+ $1 $+ > $mta.nick($1,$2) has left the game (Reason: $iif($3 == 1,Kicked,$iif($3 == 2,Banned,Exit)) $+ ) } on *:signal:mta.text:{ if ($1 != 1) mta.text 1 <sAkina # $+ $1 $+ >< $+ $mta.nick($1,$2) $+ > $$3- if ($1 != 2) mta.text 2 <sAkina # $+ $1 $+ >< $+ $mta.nick($1,$2) $+ > $$3- if ($1 != 3) mta.text 3 <sAkina # $+ $1 $+ >< $+ $mta.nick($1,$2) $+ > $$3- if ($1 != 4) mta.text 4 <sAkina # $+ $1 $+ >< $+ $mta.nick($1,$2) $+ > $$3- } on *:signal:mta.command:{ if ($1 != 1) mta.text 1 <sAkina # $+ $1 $+ >< $+ $mta.nick($1,$2) $+ > $$3- if ($1 != 2) mta.text 2 <sAkina # $+ $1 $+ >< $+ $mta.nick($1,$2) $+ > $$3- if ($1 != 3) mta.text 3 <sAkina # $+ $1 $+ >< $+ $mta.nick($1,$2) $+ > $$3- if ($1 != 4) mta.text 4 <sAkina # $+ $1 $+ >< $+ $mta.nick($1,$2) $+ > $$3- } Didn't test it, so let me know if it doesn't work
  20. You forgot the { brackets after the else on *:SIGNAL:mta.text: { if ($3 == brb) { if ($readini($scriptdir $+ status.ini,players,$mta.nick($1,$2)) == BRB) { mta.pm $1 $2 Your status are already set to "Be right back!" } else { mta.text $1 $mta.nick($1,$2) will be right back! $iif($4,Reason: $4-) mta.pm $1 $2 Your status have been set to "Be right back!" !writeini -n " $+ $scriptdir $+ status.ini" Players $mta.nick($1,$2) BRB } } elseif ($3 == back) { if (!$readini($scriptdir $+ status.ini,players,$mta.nick($1,$2))) { mta.pm $1 $2 Your status are not set to "Away!" } else { mta.text $1 $mta.nick($1,$2) is back, and better then ever! mta.pm $1 $2 Your status have been reset to normal. !remini " $+ $scriptdir $+ status.ini" Players $mta.nick($1,$2) } } }
  21. you can't choose them but you can do "/me " for purple text
  22. i think it's somewhere at the farm objects
  23. SDK

    2 ideas.

    You didn't have free aim when you were driving a car in SP, and now you can do it in DM. Maybe its possible?
×
×
  • Create New...