
Xeno
Members-
Posts
728 -
Joined
-
Last visited
Everything posted by Xeno
-
The script works fine when I use the "log in" function, its only when I register a new account EDIT: Actaully no, its only when I restart the resource it works?
-
This is what is in the admin panel Name current default MaxZombies 100 100 speed 1 1 SteamMethod 1 1 And no, the only objects i have are a few fences.
-
ZombieStreaming = get("zombies.StreamMethod") Thats what I have there. Is it right?
-
So pretty much, im using the Z day zombie script, and I've made some safe areas and a spawn position for new players. So basically, once the player has registered, and goes to the blip on the map (No zombies are spawned along the way either). Once you get to the Blip, your in the safe zone, but if you go out the safe zone, and try to look for zombies, they dont spawn? Is there a certain thing I need to do to make them spawn? Do I have to use like spawnPlayer so teh zombies know I have spawned? Because Im using setElementPosition atm
-
1. I dont know, ill fix it now. 2. I know how to do onPlayerQuit, its the saving bit I dont know how to do. -PS, the zombie kill count now saves? I must of tested it wrong. But I still need help with the first question -PS Never mind, i fixed both, thanks all! Try using the code, that you know works, from the previous topic. If it worked at some point, it still has to work Look through your code. Must be something you have created AFTER adding the greenzone code thats causing a problem. I already fixed it, I didn't set the cood's correctly.
-
1. I dont know, ill fix it now. 2. I know how to do onPlayerQuit, its the saving bit I dont know how to do. -PS, the zombie kill count now saves? I must of tested it wrong. But I still need help with the first question -PS Never mind, i fixed both, thanks all!
-
1. The safe area you guys made in the previous post just suddenly stopped working? Zombies can now walk through it? local greenzone = createColRectangle ( 903, -1325, 150,100 ) local greenzonemaparea = createRadarArea (903,-1325, -150, -100, 0, 255, 0) function greenzoneEnter ( element, matchingDimension ) local t = getElementType( element ) if t == "player" then elseif t == "ped" then killPed ( element ) end end addEventHandler ( "onColShapeHit", greenzone, greenzoneEnter ) function greenzoneExit ( thePlayer, matchingDimension, player) if getElementType( thePlayer ) ~= "player" then return end triggerClientEvent (player, "onMarkerHitText1", getRootElement()) end addEventHandler ( "onColShapeLeave", greenzone, greenzoneExit ) 2. I made a script to count the number of zombies killed on the score board, and I dont knwo how to make it so it saves on logout/reconnect ect, could you help me please? addEvent("onZombieWasted",true) addEventHandler("onZombieWasted",root, function (killer) givePlayerMoney(killer,100) addPlayerZombieKills(killer) end) function addPlayerZombieKills(killer) local account = getPlayerAccount(killer) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zombie kills") if not zombieKills then setAccountData(account,"Zombie kills",0) end setAccountData(account,"Zombie kills",tonumber(zombieKills)+1) end addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zombie kills") if zombieKills then setElementData(source,"Zombie kills",tostring(zombieKills)) else setElementData(source,"Zombie kills",0) end end) - I promise, I will soon stop asking as frequently as I do!
-
Ah, I restarted the local server and it worked.
-
Castillo, I have a problem again and I don't know what's wrong, it seems my warpPedIntoVehicle isn't working on ANYTHING, on my Admin panel when you spawn a car, it doesn't work, it spawns the car underneath, and on all my scripts it doesn't warp into the vehicle. Any idea what's wrong?
-
Shit. LOL. Thanks, I didn't check the script correctly
-
I'm not sure what is happening! I do setElementPosition, and the radar blips and my map objects all teleport too the place where I set the setElementPosition function doneButton(thePlayer) guiSetVisible(guiSkinShop,false) guiSetVisible(windowLogin, false) showCursor(false) triggerServerEvent("setCameraRegister", getRootElement()) end function setCameraRegister(player, thePlayer) setTimer(setElementPosition,1000,1,source, 120,-1021,23.2) setTimer( setCameraTarget,1200,1, source ) setTimer ( fadeCamera, 50, 1, source,false, 1 ) setTimer ( fadeCamera, 3000, 1, source,true, 3 ) setElementFrozen ( source, false ) showPlayerHudComponent ( source, "radar", true ) showChat(source, true) end
-
How would I make it so if a ped walks into a colShape, it kills him? NPC = createPed( ect ect ect... function greenzoneEnter ( thePlayer, matchingDimension ) if getElementType( thePlayer ) ~= "player" then return end outputChatBox ( "* You Entered The Safezone!", thePlayer, 50, 252, 3 ) else killPed(hitPlayer) end addEventHandler ( "onColShapeHit", greenzone, greenzoneEnter ) I know how to make it so only certain skins can get in, but I want it so ALL players can get in. Thanks, Xeno
-
Oh... So I just throw it in the script and it will work?
-
See this example. This is one way of saving the skin, for the next time the player connects. function onMapLoad () -- create our table, if it doesn't already exist executeSQLCreateTable ( "players", "clothes_head_texture TEXT, clothes_head_model TEXT, player TEXT" ) end addEventHandler ( "onGamemodeMapStart", getRootElement(), onMapLoad ) function addInfoToSQL( theSpawnpoint, theTeam ) sourcename = getPlayerName ( source ) -- get the player's name -- try to retrieve the player data from the db result = executeSQLSelect ( "players", "player", "player = '" .. sourcename .. "'" ) if ( result == false ) then -- see if any data was found at all outputChatBox ( "This is your first time here! Welcome " .. sourcename .. "!", source ) executeSQLInsert ( "players", "'none', 'none', '" .. sourcename .. "'" ) else outputChatBox ( "Welcome back " .. sourcename .. "!", source ) executeSQLUpdate ( "players", "clothes_head_texture = 'hairgreen', clothes_head_model = 'somehead'", "player = '" .. sourcename .. "'" ) end -- get the clothes data for the player result = executeSQLSelect ( "players", "clothes_head_texture, clothes_head_model", "player = '" .. sourcename .. "'" ) outputChatBox ( "Your head texture is " .. result[1][1] ) outputChatBox ( "Your head model is " .. result[1][2] ) end addEventHandler ( "onPlayerSpawn", getRootElement(), addInfoToSQL ) https://wiki.multitheftauto.com/wiki/ExecuteSQLUpdate And for getting the players current skin use. https://wiki.multitheftauto.com/wiki/GetElementModel I swear you need a special server to use SQL?
-
And how would I save skin? the same but change around the functions
-
function setTeam() local account = getPlayerAccount(source) local team = getAccountData (account, "team") if (team) and getTeamFromName(team) then setPlayerTeam(source, getTeamFromName(team)) end end addEventHandler("onPlayerLogin",root,setTeam) function save(player) local team = getPlayerTeam(player) local account = getPlayerAccount(player) if (team) and not isGuestAccount(account) then setAccountData(account, "team", getTeamName(team)) end end addEventHandler("onPlayerQuit", getRootElement(), save) I used this script to save teams, and I have no idea why its not working, can someone help me please? I get no errors.
-
Thanks guys, really helped me there :3
-
Oh, I did try that, but i forgot to put the IP in the "" so it didn't work. Thanks man.
-
How would I disable the "logout" command? Or, how would I make it so if someone logged out, it would force them to reconnect? Thanks for your help, Xeno.
-
You were both right, I had it too soon. I feel very dumb, i seem to get stuck on the little easy errors -.- Thank you all who helped me
-
Its something wrong with the addEventHandler, it says that it expect a gui-element at argument 1.... But "right" is gui... edit: read the wrong debug, lol, it says it neds a function at argument 3, but as I said before, argument 3 has a function in it...
-
Client, and debug shows nothing
-
That doesnt work Thanks for replying though ;3