Michael_Sund
Members-
Posts
161 -
Joined
-
Last visited
Everything posted by Michael_Sund
-
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
Ok, thx i did as you said, it works great now i'll add teamArmy -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
function fadeInOnStart ( ) fadeCamera ( source, true, 1.0 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), fadeInOnStart ) will this solve the "black" problem? And what should i do with this function assignCivilian ( ) setPlayerTeam ( source, teamCivilians ) setElementPosition( player, 2230.8967, -1159.5858, 25.8268 ) -- this setElementPosition doesn't work get "bad argument" on it outputChatBox( "You are a civilian", player, 0, 255, 0 ) end addEventHandler ( "onPlayerJoin", getRootElement(), assignCivilian ) and this function setCivilian ( source, commandName ) setPlayerTeam ( source, teamCivilians ) takeAllWeapons ( source ) setPlayerSkin ( source, 0 ) setElementPosition( player, 2230.8967, -1159.5858, 25.8268 ) -- this setElementPosition doesn't work get "bad argument" on it too outputChatBox( "You are a civilian", player, 0, 255, 0 ) end addCommandHandler ( "civilian", setCivilian ) ? -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
You must fade the camera in. It is faded out by default. That's why your screen stays black when you start a blank game mode. http://development.mtasa.com/index.php?title=FadeCamera LOL that sounds really retard well thanks =) -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
Hmm the outputChatBox functions works but not setElement position and btw i got ERROR Bad argument @ 'setElementPosition' And another problem i had since i started, i first used broph's files but i deleted all of them but the map file, and started making my own, but if i don't use "freeroam" it's just black... -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
Ok, new progress on the "team script". function createTeamsOnStart () teamCivilians = createTeam ( "Civilians", 194, 194, 194 ) teamCops = createTeam ( "Cops", 101, 101, 215 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) function assignNewTeam ( source, commandName ) setPlayerTeam ( source, teamCops ) giveWeapon ( source, 31, 10000 ) giveWeapon ( source, 24, 10000 ) giveWeapon ( source, 25, 10000 ) giveWeapon ( source, 29, 10000 ) giveWeapon ( source, 17, 10000 ) giveWeapon ( source, 42, 10000 ) setPlayerSkin ( source, 283 ) setElementPosition( player, 1552.4109, -1675.0485, 16.1953 ) outputChatBox( "You are now logged in as a Los Santos Police Department officer", player, 0, 255, 0 ) end addCommandHandler ( "police", assignNewTeam ) function setCivilian ( source, commandName ) setPlayerTeam ( source, teamCivilians ) takeAllWeapons ( source ) setPlayerSkin ( source, 0 ) setElementPosition( player, 2230.8967, -1159.5858, 25.8268 ) outputChatBox( "You are a civilian", player, 0, 255, 0 ) end addCommandHandler ( "civilian", setCivilian ) function assignCivilian ( ) setPlayerTeam ( source, teamCivilians ) setElementPosition( player, 2230.8967, -1159.5858, 25.8268 ) outputChatBox( "You are a civilian", player, 0, 255, 0 ) end addEventHandler ( "onPlayerJoin", getRootElement(), assignCivilian ) I will now test if my setElementPosition and the outputChatBox works -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
nah i fixed the problem look at the newest quote i did before this -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
Oh, 50p i did wrong i check the saved_coords.txt in the resource folder i should have looked in the one in resourcecache my bad -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
but i wanna save the position instead so i can look on it later -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
50p! can you help me? I did "//" with your saveposition script enabled, it said position saved but nothing was in the file when i checked -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
Oh, i missed this reply, sorry then i'll just downlooad that to save time, Gamesnert thx anyway Thanks 50p too =) -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
I wanted to save the position of a player so i can use it to put cars and stuff there, because i haven't heard of a /save command as in SA-MP -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
Ok thx, i will put that on my server and test in about 2 hours! i really needed that -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
C00L! Can you help me making a /savepos command? I tried to but the best i could was function savePosition ( source, commandName ) local playerPos = getElementPosition ( player ) local hFile = fileOpen("savedpositions.txt", false) if hFile then fileWrite(hFile, "Coordinates: " .. playerPos ) fileClose(hFile) end addCommandHandler ( "savepos", savePosition ) function makePositionFile ( source, commandName ) local newFile = fileCreate("savedpositions.txt") if newFile then fileClose(newFile) end addCommandHandler ( "makeposfile", makePositionFile ) but i think something is wrong in there Well g2g and sleep now, but i'll check your answer tomorrow (If you answered! 666 ) -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
Thanks, but i'm only 13 years old and haven't really understood what to use those tables for that xml maybe is good tho... -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
Ok, this is my current job on the script function createTeamsOnStart () teamCivilians = createTeam ( "Civilians", 194, 194, 194 ) teamCops = createTeam ( "Cops", 101, 101, 215 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) function assignNewTeam ( source, commandName ) setPlayerTeam ( source, teamCops ) giveWeapon ( source, 31, 10000 ) giveWeapon ( source, 24, 10000 ) giveWeapon ( source, 25, 10000 ) giveWeapon ( source, 29, 10000 ) giveWeapon ( source, 17, 10000 ) giveWeapon ( source, 42, 10000 ) setPlayerSkin ( source, 283 ) end addCommandHandler ( "secret", assignNewTeam ) function setCivilian ( source, commandName ) setPlayerTeam ( source, teamCivilians ) takeAllWeapons ( source ) setPlayerSkin ( source, 0 ) end addCommandHandler ( "civilian", setCivilian ) function assignCivilian ( ) setPlayerTeam ( source, teamCivilians ) end addEventHandler ( "onPlayerJoin", getRootElement(), assignCivilian ) It works perfectly -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
source==nil. Why? OnPlayerJoin has NO PARAMETERS! Still, you did list source, commandName. But they'll just be nil. (for as far as I know...) Solution? Remove source,commandName in line 1. Ok, it works but i still get a warning but that's not important -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
Ok, heres is an update of the team script... function createTeamsOnStart () teamCivilians = createTeam ( "Civilians", 194, 194, 194 ) teamCops = createTeam ( "Cops", 101, 101, 215 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) --we attach the function to this resource's root element function assignNewTeam ( source, commandName ) setPlayerTeam ( source, teamCops ) end addCommandHandler ( "command", assignNewTeam ) function assignCivilian ( source, commandName ) setPlayerTeam ( source, teamCivilians ) end addEventHandler ( "onPlayerJoin", getRootElement(), assignCivilian ) function setCivilian ( source, commandName ) setPlayerTeam ( source, teamCivilians ) end addCommandHandler ( "civilian", setCivilian ) Everything but function assignCivilian ( source, commandName ) setPlayerTeam ( source, teamCivilians ) end addEventHandler ( "onPlayerJoin", getRootElement(), assignCivilian ) works, i want to make it so when a player joins it puts him in teamCivilian. Can you find the errors? -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
should be: function assignNewTeam ( source, commandName ) setPlayerTeam ( source, teamCops) -- the team "Cops" doesn't exist according to your code, teamCops does, however. end addCommandHandler ( "command", assignNewTeam ) -- if "command" is what you type in the console, in order to activate the function, shouldn't the word be more be something more descriptive such as "assignToCops" ? LOL i just did that without seeing your post, i just guessed i'm so happy my first 10 lines of lua works :') -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund replied to Michael_Sund's topic in Scripting
function createTeamsOnStart () teamCivilians = createTeam ( "Civilians", 194, 194, 194 ) teamCops = createTeam ( "Cops", 101, 101, 215 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) --we attach the function to this resource's root element function assignNewTeam ( source, commandName ) setPlayerTeam ( source, Cops ) end addCommandHandler ( "command", assignNewTeam ) Ok here is the current team script, the "createTeamsOnStart" works but not the "assignNewTeam" why? Ok, i changed setPlayerTeam ( source, Cops ) to setPlayerTeam ( source, teamCops ) Now it works! -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Michael_Sund posted a topic in Scripting
I will try making a gamemode, i will post all stuff i got problem with and tell you what i have done. -
This would be cool if you want to pick something up, hope this will be fixed in DP 3.0
-
I got NVidia GeForce 6100 LE, AMD Sempron Processor 3400+ (MMX, 3DNow, ~1.8GHz), 766 mb RAM. I can run MTA and GTA
-
Yeah i have experienced that some times
-
LOL i didn't see that
-
LOL it didn't work nothing happened when i started it yeah i can't script anything the only thing i actually made working weas TP's