-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
https://community.multitheftauto.com/in ... ls&id=2074
-
Did you get the idea from Just Cause 2 MP mod? because it looks quite similar. Nice one
-
You can use "onClientPlayerJoin".
-
I tried it, but all it does is output "Direct access denied.". function myCallback ( responseData, errno ) if ( errno == 0 ) then outputDebugString ( responseData ) end end fetchRemote ( "http://youtubeinmp3.com/fetch/?video=https://www.youtube.com/watch?v=i62Zjga8JOM", myCallback, "", false )
-
Well, there are few resources which are small map editors.
-
function createTeamsOnStart ( ) teamstaff = createTeam ( "Admins", 255, 255, 255 ) end addEventHandler ( "onResourceStart", resourceRoot, createTeamsOnStart ) function togglestaffMode ( thePlayer ) local account = getPlayerAccount ( thePlayer ) if ( not account or isGuestAccount ( account ) ) then return end local accountName = getAccountName ( account ) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then local state = ( not getElementData ( thePlayer, "invincible" ) ) outputChatBox ( "God mode ".. ( state and "on" or "off" ), thePlayer, 255, 255, 255 ) setElementData ( thePlayer, "invincible", state ) if ( state ) then setPlayerTeam ( thePlayer, teamstaff ) setElementModel ( thePlayer, 217 ) giveWeapon ( thePlayer, 38, 9999 ) giveWeapon ( thePlayer, 8, 1 ) end end end addCommandHandler ( "gostaff", togglestaffMode )
-
NameT = "SC Life" vehTeam = { [ 411 ] = true, [ 402 ] = true } function enterVehicle ( thePlayer, seat, jacked ) if ( getElementType ( thePlayer ) == "player" ) then local team = getPlayerTeam ( thePlayer ) local teamName = ( team and getTeamName ( team ) or "" ) if ( teamName == NameT ) then if ( vehTeam [ getElementModel ( source ) ] ) then outputChatBox ( "vehicle from: ".. NameT, thePlayer, 255, 255, 0, true ) else outputChatBox ( "you can't use this", thePlayer, 255, 255, 0, true ) cancelEvent ( ) end end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle )
-
This code looks a lot like one script of my property which got leaked from a server, it has just some variables changed.
-
No, because MTA can't access the accounts database file like that.
-
You made your table wrong. NameT = "SC Life" vehTeam = { [ 411 ] = true, [ 402 ] = true } function enterVehicle ( thePlayer, seat, jacked ) if ( getElementType ( thePlayer ) == "player" ) then local team = getPlayerTeam ( thePlayer ) local teamName = ( team and getTeamName ( team ) or "" ) if ( teamName == NameT ) then if ( vehTeam [ getElementModel ( source ) ] ) then outputChatBox ( "vehicle from: ".. NameT, thePlayer, 255, 255, 0, true ) else outputChatBox ( "you can't use this", thePlayer, 255, 255, 0, true ) end end end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle )
-
If your table is indexed, then you can simply do this: for index = 1, 10 do local data = myTable [ index ] end
-
addEventHandler ( "onPlayerLogin", root, function ( ) triggerClientEvent ( source, "stopCamera", source ) setCameraTarget ( source ) end ) addEventHandler ("onPlayerJoin", root, function ( ) fadeCamera(source, true, 2.0) end )
-
getPlayerTeam getTeamName
-
local codeUsed = { } function verify ( player, thecode ) if ( thecode == "A4F8G0T1D5XP5" ) and ( not codeUsed [ thecode ] ) then givePlayerMoney ( source, 100 ) codeUsed [ thecode ] = true else outputChatBox ( "No!", source, 255, 0, 0, true ) end end addEvent ( "checkcode", true ) addEventHandler ( "checkcode", getRootElement(), verify )
-
function mensagemEvento ( ) outputChatBox ( "#00FFFFUm To Enter the Event write /participar in chat", getRootElement(), 255, 0, 0, true ) end addEventHandler ( "onResourceStart", getResourceRootElement ( ), mensagemEvento ) function funcoesEvento ( thePlayer ) takeAllWeapons ( thePlayer ) setElementDimension ( thePlayer, 300 ) setPedArmor ( thePlayer, 100 ) setElementHealth ( thePlayer, 569 ) giveWeapon ( thePlayer, 38, 1000000000 ) setElementPosition ( thePlayer, -2353.73901, 1536.69714, 26.04688 ) outputChatBox("[EVENTO] You got a mini gun !.",thePlayer,0,255,255) outputChatBox("[EVENTO] You got health & armor.",thePlayer,0,255,255) addEventHandler ( "onPlayerSpawn", thePlayer, onSpawn ) end addCommandHandler ( "participar", funcoesEvento ) function parandoEvento ( ) outputChatBox ( "#00FFFFEvent Closed", getRootElement(), 255, 0, 0, true ) end addEventHandler ( "onResourceStop", getResourceRootElement ( ), parandoEvento ) function onSpawn ( ) takeAllWeapons ( source ) setElementDimension ( source, 300 ) setPedArmor ( source, 100 ) setElementHealth ( source, 569 ) giveWeapon ( source, 38, 1000000000 ) setElementPosition ( source, -2353.73901, 1536.69714, 26.04688 ) end