-
Posts
378 -
Joined
-
Last visited
Everything posted by Sparrow
-
I'm working on some RPG jobs to get more skills in scripting, so this what I do, no errors. function createPoliceTeam() policeTeam = createTeam ("Police", 25, 50, 255) end addEventHandler ("onResourceStart", getRootElement(), createPoliceTeam) local jobMarker = createMarker (1574.700, -1634.300, 12.600, "cylinder", 1.5, 25, 50, 255, 255) function setJob(hitElement, thePlayer) local wanted = getPlayerWantedLevel (thePlayer) if (wanted == 0) then if getElementType(hitElement) == "player" then playerName = getPlayerName ( getLocalPlayer() ) if not guiGetVisible(window) then guiSetVisible(window, true) showCursor(true) elseif (wanted > 0) then showCursor(false) guiSetVisible(window, false) end end end end addEventHandler("onClientMarkerHit", jobMarker, setJob) function acceptJob (thePlayer) local getTeam = getTeamFromName ("Police") if theTeam then setPlayerTeam (thePlayer, getTeam) setElementModel (thePlayer, 280) guiSetVisible(window, false) showCursor(false) outputChatBox ("You are now police officer.", thePlayer, 0,255, 0) else outputChatBox ("You are wanted, you can not take this job.", thePlayer, 255, 0, 0) end end addEventHandler("onClientGUIClick", acceptButton , acceptJob, false) it didn't set me in "Police" team, and it says that I'm wanted. how to fix this? and thanks.
-
salut tout le monde, comment je fais une list des voitures dans un grid list? svp, aide moi merci bcp.
-
thanks for this help...
-
I mean when player do /changeteam he get the skin of that team... E.g: /changeteam Army, he get the army skin (ID: 287)
-
I mean: function setMyTeam( player, cmd, ... ) local name = table.concat({...}, " ") if (name and name ~= "") then local team = getPlayerTeam( player ) if setPlayerTeam ( player, getTeamFromName( name ) ) then setElementModel (player, team) outputChatBox( "Your team now is "..getTeamName( getPlayerTeam( player ) )..".", player, 0, 255, 0 ) else outputChatBox( "Access Denied.", player, 255, 0, 0 ) end else outputChatBox( "SYNTAX: /changeteam [team name].", player, 255, 0, 0 ) end end addCommandHandler ( "changeteam", setMyTeam )
-
another question please, when I use /changeteam command, I get another team and I didn't get his skin, so I must add setElementModel (player, team) after if setPlayerTeam ( player, getTeamFromName( name ) ) then
-
it's working now, thanks
-
didn't work it still says that I'm Alreadly in team, and it didn't set my team to the new one.
-
this didn't work, I changed the command, but it says that I'm Alreadly in team function setMyTeam( player,_,name ) if name then local team = getPlayerTeam( player ) if not team then if setPlayerTeam ( player, getTeamFromName( name ) ) then outputChatBox( "Your team now is "..getTeamName( getPlayerTeam( player ) )..".", player, 0, 255, 0 ) else outputChatBox( "Can't set to team.", player, 255, 0, 0 ) end else outputChatBox( "Alreadly in team.", player, 255, 0, 0 ) end else outputChatBox( "SYNTAX: /newteam [team name].", player, 255, 0, 0 ) end end addCommandHandler ( "newteam", setMyTeam )
-
this didn't work, no errors but in chatbox: Test is the team.
-
hm, I want it to set the player in team after he type /setteam function setMyTeam( player ) local team = getPlayerTeam( player ) if team then setPlayerTeam (player, team) outputChatBox( "Your team now is "..getTeamName( team )..".", player, 0, 255, 0 ) else outputChatBox( "Bara nayek.", player, 255, 0, 0 ) end end addCommandHandler ( "setteam", setMyTeam ) it didn't set me in team.
-
they are in internal.db
-
my code: function setMyTeam(source) local getTeam = getTeamName (source) if (getTeam) then outputChatBox("Your team now is "..getTeamName..".", source, 0, 255, 0) else outputChatBox("Bara nayek.", source, 255, 0, 0) end end addCommandHandler ("setteam", setMyTeam)
-
why when I do this: local getTeam = getTeamName (source) it comes error:
-
copy what was writed in /guiprint
-
function createGuiWindow() -- set here the GUI elements. end -- bind this GUI with key function onResourceStart () bindKey ("F7", "down", showUserPanel) guiSetVisible (window, false) -- window the variable name of the GUI window. end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart)
-
post your script so we can help you.
-
I want this script to jail wanted players if they quit and a police was near them, I try this and didn't work, also no errors: function sendToJail(policePlayer, wantedPlayer) local playerTeam = getPlayerTeam (policePlayer) if (playerTeam) then local team = getTeamFromName ("Police") local x, y, z = getElementPosition (wantedPlayer) local marker = createMarker (x, y, z, "cylinder", 7, 255, 255, 255, 255) local wanted = getPlayerWantedLevel (wantedPlayer, math.random(1, 6)) if (wanted and marker) then setElementInterior (wantedPlayer, 5) setElementPosition (wantedPlayer,319,315,999) outputChatBox ("You arrested a quiter.", policePlayer, 0, 255, 0) givePlayerMoney (policePlayer, 2500) end end end addEventHandler ("onPlayerQuit", getRootElement(), sendToJail)
-
post the .zip file at your mta folder/mods/deathmatch/recources/gameplay
-
you forget the "end", also the error in mtaserver.exe is not what is in this script. addEventHandler("onPlayerVehicleEnter", root, function(vehicle, seat, jacked) if getTeamName(getPlayerTeam(source)) == "Police" then if getElementData(source, "Cuffed") then return end local model = getElementModel(vehicle) if model == 598 or model == 596 or model == 597 or model == 427 or model == 490 or model == 599 then if getPlayerWantedLevel(source) < 6 then setPlayerWantedLevel(source, getPlayerWantedLevel(source) + 1) end end end end)
-
local theVehicle = getPedOccupiedVehicle function rndColors() local color = {} color[1] = math.random(0,126) color[2] = math.random(0,126) color[3] = math.random(0,126) color[4] = math.random(0,126) setVehicleColor ( theVehicle, color[1], color[2], color[3], color[4] ) outputChatBox( "Enjoy the PARTY!", source, 0, 255, 0 ) end function makeTimer() if ( theVehicle == false ) then outputChatBox ( "Get into a vehicle first!", getRootElement(), 255, 50, 0, true ) else setTimer( rndColors, 100, 1 ) outputChatBox ( "You are in vehicle!!", getRootElement(), 255, 50, 0, true ) end end addCommandHandler(" discovehicle", makeTimer )
-
ok thank you for this fast answer
-
hello peeps, I'm going to do gang system, and I want to know what functions are the best for this, I need to do it with: accountData or database or MySQL or SQLite. thank you