
AHSS
Members-
Posts
87 -
Joined
-
Last visited
Everything posted by AHSS
-
i tried to make a bot that follows i made like this the slothbot.edf: "AI"> "pathpoint" friendlyname="Path point" icon="edf/flag/flag.png"> "position" type="coord3d" default="410.5979,-1543.6353,32.2734"/> "2993" rotation="0,0,0"/> and in the script:(another resource) local gResRoot = getResourceRootElement(getThisResource()) function spawnbots() local bot = call (getResourceFromName("Slothbot"), "spawnBot", 1498.3390,-1582.3936,13.5469, 0, 192, 0, 0, 0, 0, "following", "pathpoint") end addEventHandler("onResourceStart", gResRoot, spawnbots) the bot spawns be he stand till untill i approach then he attacks me but he doesnt go to the pathpoint also i did this function spawnbots() local player = getPlayerFromName ("Name") local bot = call (getResourceFromName("Slothbot"), "spawnBot", 1498.3390,-1582.3936,13.5469, 0, 192, 0, 0, 0, 0, "following", player) end addEventHandler("onResourceStart", gResRoot, spawnbots) my name was correct no errors but same bot just stand untill i approach then he attacks me
-
i wanna make a record of what i do and then create a ped and make it do the same
-
how to make bots/peds that do a certain thing i record like i record my self driving in a car and then make a bot/ped that do the same is this possible??
-
im not asking for the script im just asking how to check if a player got a house and how to get the coords of that house
-
i want the owner of the house to spawn at the house like at the coordinates of teleport outside of the house when u /hpanel u will see "teleport out side of the house" and pick coords i want the player to spawn there if he owns a house ty
-
i wanna know how to make a text display appears for all players i tried this textDisplayAddObserver ( textdisplay, getRootElement()) didnt work help plz
-
i mean making like a pizza mission when some one enter the marker a new marker appear but i want the new marker to be in a random place i mean random coord so i wanna make like 3 coords and when the player enters the start mission marker it dissapears and another one appear the x,y,z of the marker will be a random one of the 3 coords
-
i wanna make a few coordinates and pick random one of it like 3 coordinates for something and it will auto pick one of them thanks
-
ok ok i will give u all the codes first the saving (it works it do saves and i see it in the file) PS: GPN function is a function that i did it gets the player name and store it in pname function savepstats() GPN(source) local pfile = xmlLoadFile("RPG-Files/"..pname..".xml") if(pfile) then local pmoney = getPlayerMoney(source) local pteam = getPlayerTeam" class="kw2">getPlayerTeam(source) local pskin = getPedSkin(source) local alevel = getElementData(source, "alevel") local pip = getPlayerIP(source) xmlNodeSetAttribute(pfile, "money", pmoney) if(pteam) then local pteamname = getTeamName(pteam) xmlNodeSetAttribute(pfile, "teamname", pteamname) else xmlNodeSetAttribute(pfile, "teamname", "null") end xmlNodeSetAttribute(pfile, "skin", pskin) xmlNodeSetAttribute(pfile, "alevel", tostring(alevel)) xmlNodeSetAttribute(pfile, "ip", pip) for slot=0, 12 do if (getPedWeapon(source, slot) ~= 0) then local weapon = getPedWeapon(source, slot) local ammo = getPedTotalAmmo(source, slot) xmlNodeSetAttribute(pfile, "weapon"..slot, weapon) xmlNodeSetAttribute(pfile, "ammo"..slot, ammo) end end xmlSaveFile(pfile) end end addEventHandler("onPlayerQuit", getRootElement(), savepstats) ok now loading iam making a auto login system when a player connects he login automatically here is the code : function JoinHandler() GPN(source) local pfile = xmlLoadFile("RPG-Files/"..pname..".xml") if(pfile) then outputChatBox("#00FF00 You are registered and automatically logged in", source, 0, 0, 0, true) local pmoney = xmlNodeGetAttribute(pfile, "money") local pteamname = xmlNodeGetAttribute(pfile, "teamname") if(pteamname ~= "null") then local pteam = getTeamFromName(pteamname) setPlayerTeam" class="kw6">setPlayerTeam(source, pteam) end local pskin = xmlNodeGetAttribute(pfile, "skin") local alevel = xmlNodeGetAttribute(pfile, "alevel") local w1 = xmlNodeGetAttribute(pfile, "weapon1") local w2 = xmlNodeGetAttribute(pfile, "weapon2") local w3 = xmlNodeGetAttribute(pfile, "weapon3") local w4 = xmlNodeGetAttribute(pfile, "weapon4") local w5 = xmlNodeGetAttribute(pfile, "weapon5") local w6 = xmlNodeGetAttribute(pfile, "weapon6") local w7 = xmlNodeGetAttribute(pfile, "weapon7") local w8 = xmlNodeGetAttribute(pfile, "weapon8") local w9 = xmlNodeGetAttribute(pfile, "weapon9") local w10 = xmlNodeGetAttribute(pfile, "weapon10") local w11 = xmlNodeGetAttribute(pfile, "weapon11") local w12 = xmlNodeGetAttribute(pfile, "weapon12") local a1 = xmlNodeGetAttribute(pfile, "ammo1") local a2 = xmlNodeGetAttribute(pfile, "ammo2") local a3 = xmlNodeGetAttribute(pfile, "ammo3") local a4 = xmlNodeGetAttribute(pfile, "ammo4") local a5 = xmlNodeGetAttribute(pfile, "ammo5") local a6 = xmlNodeGetAttribute(pfile, "ammo6") local a7 = xmlNodeGetAttribute(pfile, "ammo7") local a8 = xmlNodeGetAttribute(pfile, "ammo8") local a9 = xmlNodeGetAttribute(pfile, "ammo9") local a10 = xmlNodeGetAttribute(pfile, "ammo10") local a11 = xmlNodeGetAttribute(pfile, "ammo11") local a12 = xmlNodeGetAttribute(pfile, "ammo12") givePlayerMoney(source, pmoney) setPedSkin(source, pskin) giveWeapon(source, tonumber(w1), tonumber(a1)) giveWeapon(source, tonumber(w2), tonumber(a2)) giveWeapon(source,tonumber(w3), tonumber(a3)) giveWeapon(source, tonumber(w4), tonumber(a4)) giveWeapon(source, tonumber(w5), tonumber(a5)) giveWeapon(source, tonumber(w6), tonumber(a6)) giveWeapon(source, tonumber(w7), tonumber(a7)) giveWeapon(source, tonumber(w8), tonumber(a8)) giveWeapon(source, tonumber(w9), tonumber(a9)) giveWeapon(source, tonumber(w10), tonumber(a10)) giveWeapon(source, tonumber(w11), tonumber(a11)) giveWeapon(source, tonumber(w12), tonumber(a12)) setElementData(source, "alevel", tostring(alevel)) if(alevel == "1" or alevel == "2" or alevel == "3" or alevel == "4") then outputChatBox("#41A317 Admin "..pname.." has logged in . Admin level "..alevel.." !", getRootElement(), 0, 0, 0, true) end else outputChatBox("#FFFFFF You are not registered please use /register ", source, 0, 0, 0, true) end end addEventHandler("onPlayerJoin", getRootElement(), JoinHandler) so this is it problem is that the weapons is not given to the player but every thing else works like saving the player team and loading it works money also works so the problem is in weapons all i get is warnings WARINING: it gives me bad argument @ "giveWeapon"
-
i did this function savestats() --then here the code in the first post end that what i did why its not working all the problem that i dont get the weapon PS: THE SAVING IS WORKING
-
i got this code -- when a player login (the function is not the problem cuz other codes work and other loads work) local w1 = xmlNodeGetAttribute(pfile, "weapon1") local w2 = xmlNodeGetAttribute(pfile, "weapon2") local w3 = xmlNodeGetAttribute(pfile, "weapon3") local w4 = xmlNodeGetAttribute(pfile, "weapon4") local w5 = xmlNodeGetAttribute(pfile, "weapon5") local w6 = xmlNodeGetAttribute(pfile, "weapon6") local w7 = xmlNodeGetAttribute(pfile, "weapon7") local w8 = xmlNodeGetAttribute(pfile, "weapon8") local w9 = xmlNodeGetAttribute(pfile, "weapon9") local w10 = xmlNodeGetAttribute(pfile, "weapon10") local w11 = xmlNodeGetAttribute(pfile, "weapon11") local w12 = xmlNodeGetAttribute(pfile, "weapon12") local a1 = xmlNodeGetAttribute(pfile, "ammo1") local a2 = xmlNodeGetAttribute(pfile, "ammo2") local a3 = xmlNodeGetAttribute(pfile, "ammo3") local a4 = xmlNodeGetAttribute(pfile, "ammo4") local a5 = xmlNodeGetAttribute(pfile, "ammo5") local a6 = xmlNodeGetAttribute(pfile, "ammo6") local a7 = xmlNodeGetAttribute(pfile, "ammo7") local a8 = xmlNodeGetAttribute(pfile, "ammo8") local a9 = xmlNodeGetAttribute(pfile, "ammo9") local a10 = xmlNodeGetAttribute(pfile, "ammo10") local a11 = xmlNodeGetAttribute(pfile, "ammo11") local a12 = xmlNodeGetAttribute(pfile, "ammo12") giveWeapon(source, tonumber(w1), tonumber(a1)) giveWeapon(source, tonumber(w2), tonumber(a2)) giveWeapon(source,tonumber(w3), tonumber(a3)) giveWeapon(source, tonumber(w4), tonumber(a4)) giveWeapon(source, tonumber(w5), tonumber(a5)) giveWeapon(source, tonumber(w6), tonumber(a6)) giveWeapon(source, tonumber(w7), tonumber(a7)) giveWeapon(source, tonumber(w8), tonumber(a8)) giveWeapon(source, tonumber(w9), tonumber(a9)) giveWeapon(source, tonumber(w10), tonumber(a10)) giveWeapon(source, tonumber(w11), tonumber(a11)) giveWeapon(source, tonumber(w12), tonumber(a12)) thats it also the saving code is not the problem cuz i see the save file has (weapon1="id") so the saving work oh almost forgot it also gives me a warning on each giveWeapon i got why please help
-
this is so annoying i dont get errors and its not working what iam trying to do is this function Save() local logged = getElementData(source, "logged") if(logged == "true") then --code end and i did this function log(theplayer, command, password) --code setElementData(theplayer, "logged", "true") end and it doesnt work it doesnt do the function Save i tried it with same code but another IF() (not using any element data) i just checked if a file exist like this local pfile = xmlLoadFile(--file) if(pfile) then --same code in Save function without any change end and it worked so i know the problem is with IF() know that i did this function log(theplayer, command, password) local logged = getElementData(theplayer, "logged") if(logged == "false") --code else outputChatBox("you are already logged in") end and the check goes correctly if i do log twice second time tells me that iam already logged in please help what am i doing wrong please help thanks
-
thanks it works here is my last question (its off what iam asking in the topic) when i create a team it shows it in the score board how to make it coloured as the team color? like if iam making LSP team wiht blue color when i press TAB i see the word LSP in blue how? thanks
-
i dont like using groups and acl i like using if() is there is any way else?
-
title say it all i wanna know how to make admin levels i was gonna use teams but i found out that player cant be in 2 teams and i want admins to be members in other teams and i dont know what to do please help me thanks
-
ok can i make a player in two teams?? yes or no thanks ---------------------------- edit: also if the above is possible how to kick him from 1 team but not from the other team ------------------------------- edit: ok i knew its impossible ok then how to make admins and teams? how to make a player admin and in a certain tea, thanks plz help me
-
ok thanks but still is there is something instead of col hit? like if is player in range of point? col hit is soo hard and creating a col i weird is there is any way else?? ----------------------------------------- answer the above too plz guys alsp please answer the id thing can i use players id instead of name in the commands? like /slap can i?
-
thanks it worked col shape is so hard and weird i dont understand how it work doesnt MTA contains if is player in range of certain position ------------------------------------------ edit: if i want to make a reason cmd how to make it i made 1 like that function SlapPlayer(theplayer, command, otherplayername, reason) otherplayer = getPlayerFromName(otherplayername) local x, y, z = getElementPosition(otherplayer) local pname = getPlayerName(theplayer) local gname = getPlayerName(otherplayer) z = z+5 succes = setElementPosition(otherplayer, x, y, z) if(succes) then outputChatBox(gname.." Was Slapped By Admin "..pname.." Reason : "..reason, getRootElement(), 255, 0, 0, true) else outputChatBox("Failed", theplayer) end end addCommandHandler("sslap", SlapPlayer) ok it works but the reason is only 1 word i can make it SlapPlayer(theplayer, command, otherplayername, reason1, reason2, reason3, reason4) but i gues there is more efficent way? plz help thanks
-
it doesnt work the player dies the camera keeps going up and up and nothing happens i just copied what u typed
-
ok it worked but when the player spawns hes still dead yeah he spawns but dead not alive the camera keep doing the same why?? i tried setelement health but hes still dead ------------------------------- edit: idk whats going on it doesnt work at all the player doesnt spawns at all
-
ok i will try also i did this function RespawnPlayer() setTimer(SpawnPlayerAgain, 3000, 1) end addEventHandler("onPlayerWasted", RespawnPlayer) function SpawnPlayerAgain() local x = 2228.9583 local y = -1722.1108 local z = 13.5625 succes = spawnPlayer(source, x, y, z) if(succes) then outputChatBox("Yay! Alpha Fixed The Respawn hes soo fucken happy can u plz thank him??", source, 0, 255, 0, true) else outputChatBox("OMG Alpha failed to fix the spawn thingy tell him plz", source, 0, 0, 255, true) end end but it didnt work why?? thanks
-
ok solid snake thanks but how to make the gate automatic like when the player is in a certain position the gate moves meaning i wanna know how to check if the player is near a certain pos thanks
-
@proracer no i meant in a command like /slap /kick i mean /goto and i write the id of a player not the name possible thanks thanks solidsnake
-
ok another question i wanna make when someone dies he respawns again cuz in my server when someone dies he have to /reconnect how to make something happens when a player die or how to make a player respawn when he dies?? thanks ---------------------------- also how to move and existing object that is in a diffrent MAP file and move it when any player is in a certain distance?? how? notice that the object is created in a MAP file while i am making the CMD in lua ! ----------------------------------- also how to make a lets say a /pm CMD i can make it but i wanna make it without names but with ID is there is a player id in MTA?? like getPlayerIDFromName?? thanks again
-
ok thanks but i want to understand what is i for? and what in ipairs do?? thanks