-
Posts
1,193 -
Joined
-
Last visited
Everything posted by tosfera
-
I've been thinking about an easier system too. I was thinking about creating a function that create's a gui with specified information (given as a parameter) over and over again. You can customise this as much as you want. Then create a small script for easy jobs like, hit a marker to start and a marker to finish. The rest of the extra function's like; jail, arrest, tow vehicle, repair vehicle etc you've to create other functions. but the standart functions you can create and reuse over and over again. We all hit a marker or talk to a npc to start the job. We all get a team or data that's being set, the data is being saved at all the jobs. Dont write that 1000 times, write it once with parameters!
-
oke, you have to understand this else you can better stop what you're doing and buy cookies, milk and read the entire wiki before scripting again! Server script: -- create a marker on the spot where you want the player to get the job addEventHandler("onMarkerHit", root -- add a eventhandler to trigger the event 'onMarkerHit' function ( hitElement ) -- create a function with the parameter; hitElement -- #trigger a client event to show a GUI if the player wants to get the job or not. -- #use the function; triggerclientEvent end ); addEvent( "jobAccept", true ); -- add a new event; jobAccept addEventHandler( "jobAccept", root, -- create an eventHandler for the event function ( thePlayer ) -- create a function with the parameter; thePlayer (you have to give this as an argument in your client side trigger (will place it there too) local v = createVehicle(...) -- create a vehicle on your chosen location with the chosen vehicle -- warp the player in the vehicle with the function; warpPedIntoVehicle. Give the function the parameters(thePlayer, v) -- output a message that he started the job; outputChatBox end ); addEvent( "jobFinish", true ); -- add a new event; jobFinish addEventHandler( "jobFinish", root, -- create an eventHandler for the event function ( thePlayer ) -- create a function with the parameter; thePlayer (you have to give this as an argument in your client side trigger (will place it there too) -- give the player money with; givePlayerMoney end ); client script: addEventHandler( "onClientResourceStart", getRootElement( getThisResource() ), -- add an eventHandler to handle the start of the source function () -- create the gui with the following functions -- guiCreateWindow -- guiCreateButton -- guiSetVisible -- addEventHandler("onGuiClientClick", ...) end ); function -- add a function to handle the accept button -- set the gui hidden (guiSetVisible) -- hide the cursor (showCursor) -- create a new marker as finish marker -- create a new blip as finish blip -- trigger the server event; "jobAccept" with the function; triggerServerEvent end function -- add a function to handle the cancel button -- set the gui hidden (guiSetVisible) -- hide the cursor (showCursor) end addEventHandler("onClientMarkerHit", root, -- add a eventhandler for "onClientMarkerHit" function ( hitElement ) -- add a function with the parameter hitElement -- check if the source == the name of the marker and if hitElement equals the localPlayer (use localPlayer or getLocalPlayer()) -- destroy the blip -- destroy the marker -- trigger the server event; "finishJob", (triggerServerEvent) end end );
-
Oke I'll make a layout on how the system will work. You'll have to code it! -- working on it --
-
Just check out this function on the wiki (click on it) getElementPosition. it will give you an example how to use the function.
-
Ehh you dont need to have alot of knowledge to make something like that, you have to use these functions; onMarkerHit / onClientMarkerHit createMarker createBlip destroyElement -- to destroy the marker and blip getPedOccupiedVehicle -- to see if they have a right vehicle getElementModel -- to see if they have the right skin (if you want to change the skin als use the -'s) - setElementModel getPlayerTeam -- to see if they actualy are in the team of the job givePlayerMoney triggerClientEvent triggerServerEvent that's quite it.
-
The timer is misplaced, it will only start the timer for 900 times (900 seconds in total) when you're a gangster. Not sure why you want a timer cause it already does it when the skin changes, but oke! try this; local men = { [ 0 ] = true, [ 7 ] = true, [ 14 ] = true, [ 15 ] = true, [ 16 ] = true, [ 17 ] = true, [ 18 ] = true, [ 19 ] = true, [ 20 ] = true, [ 21 ] = true, [ 22 ] = true, [ 23 ] = true, [ 24 ] = true, [ 25 ] = true, [ 26 ] = true, [ 27 ] = true, [ 28 ] = true, [ 29 ] = true, [ 30 ] = true, [ 32 ] = true, [ 33 ] = true, [ 34 ] = true, [ 35 ] = true, [ 36 ] = true, [ 37 ] = true, [ 43 ] = true, [ 44 ] = true, [ 45 ] = true, [ 46 ] = true, [ 47 ] = true, [ 48 ] = true, [ 49 ] = true, [ 50 ] = true, [ 51 ] = true, [ 52 ] = true, [ 57 ] = true, [ 58 ] = true, [ 59 ] = true, [ 60 ] = true, [ 61 ] = true, [ 62 ] = true, [ 66 ] = true, [ 67 ] = true, [ 68 ] = true, [ 70 ] = true, [ 71 ] = true, [ 72 ] = true, [ 73 ] = true, [ 78 ] = true, [ 79 ] = true, [ 80 ] = true, [ 81 ] = true, [ 82 ] = true, [ 83 ] = true, [ 84 ] = true, [ 94 ] = true, [ 95 ] = true, [ 96 ] = true, [ 97 ] = true, [ 98 ] = true, [ 99 ] = true, [ 100 ] = true, [ 101 ] = true, [ 111 ] = true, [ 112 ] = true, [ 113 ] = true, [ 117 ] = true, [ 118 ] = true, [ 120 ] = true, [ 121 ] = true, [ 122 ] = true, [ 123 ] = true, [ 124 ] = true, [ 125 ] = true, [ 126 ] = true, [ 127 ] = true, [ 128 ] = true, [ 132 ] = true, [ 133 ] = true, [ 134 ] = true, [ 135 ] = true, [ 136 ] = true, [ 137 ] = true, [ 142 ] = true, [ 143 ] = true, [ 144 ] = true, [ 146 ] = true, [ 147 ] = true, [ 153 ] = true, [ 154 ] = true, [ 155 ] = true, [ 156 ] = true, [ 158 ] = true, [ 159 ] = true, [ 160 ] = true, [ 161 ] = true, [ 162 ] = true, [ 163 ] = true, [ 164 ] = true, [ 165 ] = true, [ 166 ] = true, [ 167 ] = true, [ 168 ] = true, [ 170 ] = true, [ 171 ] = true, [ 176 ] = true, [ 177 ] = true, [ 179 ] = true, [ 180 ] = true, [ 181 ] = true, [ 182 ] = true, [ 183 ] = true, [ 184 ] = true, [ 185 ] = true, [ 186 ] = true, [ 187 ] = true, [ 188 ] = true, [ 189 ] = true, [ 200 ] = true, [ 202 ] = true, [ 203 ] = true, [ 204 ] = true, [ 206 ] = true, [ 209 ] = true, [ 210 ] = true, [ 212 ] = true, [ 213 ] = true, [ 217 ] = true, [ 220 ] = true, [ 221 ] = true, [ 222 ] = true, [ 223 ] = true, [ 224 ] = true, [ 225 ] = true, [ 226 ] = true, [ 227 ] = true, [ 228 ] = true, [ 229 ] = true, [ 230 ] = true, [ 234 ] = true, [ 235 ] = true, [ 236 ] = true, [ 240 ] = true, [ 241 ] = true, [ 242 ] = true, [ 247 ] = true, [ 248 ] = true, [ 249 ] = true, [ 250 ] = true, [ 252 ] = true, [ 254 ] = true, [ 255 ] = true, [ 258 ] = true, [ 259 ] = true, [ 260 ] = true, [ 261 ] = true, [ 262 ] = true, [ 264 ] = true, [ 274 ] = true, [ 275 ] = true, [ 276 ] = true, [ 277 ] = true, [ 278 ] = true, [ 279 ] = true, [ 280 ] = true, [ 281 ] = true, [ 282 ] = true, [ 283 ] = true, [ 284 ] = true, [ 285 ] = true, [ 286 ] = true, [ 287 ] = true, [ 288 ] = true } local girls = { [ 9 ] = true, [ 10 ] = true, [ 11 ] = true, [ 12 ] = true, [ 13 ] = true, [ 31 ] = true, [ 38 ] = true, [ 39 ] = true, [ 40 ] = true, [ 41 ] = true, [ 53 ] = true, [ 54 ] = true, [ 55 ] = true, [ 56 ] = true, [ 63 ] = true, [ 64 ] = true, [ 69 ] = true, [ 75 ] = true, [ 76 ] = true, [ 77 ] = true, [ 85 ] = true, [ 87 ] = true, [ 88 ] = true, [ 89 ] = true, [ 90 ] = true, [ 91 ] = true, [ 92 ] = true, [ 93 ] = true, [ 129 ] = true, [ 130 ] = true, [ 131 ] = true, [ 138 ] = true, [ 139 ] = true, [ 140 ] = true, [ 141 ] = true, [ 145 ] = true, [ 148 ] = true, [ 150 ] = true, [ 151 ] = true, [ 152 ] = true, [ 157 ] = true, [ 169 ] = true, [ 178 ] = true, [ 190 ] = true, [ 191 ] = true, [ 192 ] = true, [ 193 ] = true, [ 194 ] = true, [ 195 ] = true, [ 196 ] = true, [ 197 ] = true, [ 198 ] = true, [ 199 ] = true, [ 201 ] = true, [ 205 ] = true, [ 207 ] = true, [ 211 ] = true, [ 214 ] = true, [ 215 ] = true, [ 216 ] = true, [ 218 ] = true, [ 219 ] = true, [ 224 ] = true, [ 225 ] = true, [ 226 ] = true, [ 231 ] = true, [ 232 ] = true, [ 233 ] = true, [ 237 ] = true, [ 238 ] = true, [ 243 ] = true, [ 244 ] = true, [ 245 ] = true, [ 246 ] = true,
-
You want to output the spoken text by the player into a mp3 file or so? Ehh,,, then you have to create something like google translate. - retrieve the text - translate it to a mp3 file (have to be redownloaded, every. single. time! - play it I would not recommend it because there are voice functions. That allows players to talk with each other. https://wiki.multitheftauto.com/wiki/Resource:Voice
-
Not that I know of. But why do you want to use HEX Color's? Just transfer it to rgba. You can to alot more with it.
-
Yeah the camera follows the player, the only thing is that I'm controlling a ped instead of a player. I will wait till the day that the MTA Dev's allows more elements in the setCameraTarget.
-
I forgot to place a few " 's in the table. Mind placing them there so it looks like the others? I'm at my phone now haha. And the script works like this; When the player logs in, a script will loop through the table till he found the skin of the player. When he found it, it will set the walking style. You can later on trigger the function again when the players buys a new skin.
-
Yeah I found that out already. Just having a problem with the dimension. For my goal of the script is it impossible to stay in dimension 0.
-
Awesome, maybe its usefull to create the function; setCameraDimension. You can do it with fadeCamera or setCameraTarget. But its not working in the way I want it. Where can I find the; setCameraTarget source code? :3
-
Ehmm, You got the bindKey which checks if you pressed a key. Is there a way to see if its pressed and holded? Like, the W for driving. it only drives when you hold it. Any way to check that?
-
I managed to get the camera looking at the ped, I just can't check if it follows cause I can't seem to get the bindings right for the movement of the ped. SetControlState only allows player elements, for god sake... You can control Peds in a client-side script only. There is a function setPedControlState. I LOVE YOU!
-
I managed to get the camera looking at the ped, I just can't check if it follows cause I can't seem to get the bindings right for the movement of the ped. SetControlState only allows player elements, for god sake...
-
For what are you using the table? btw, you are checking if you got the model, instead of modelid. function creatvehicles( yoy, source, modelid, tablename, key, ...) if ( ( modelid ) and ( tablename ) and ( key ) ) then local modelid = tonumber( modelid ); tablename = table.concat( {...}, " " ); key = tonumber( key ); x, y, z = getElementPosition( source ); veh = createVehicle( modelid, x, y +1, z, 0 ,0 , 0, tablename ); xv, yv, zv = getElementPosition( veh ); setVehicleLocked( veh, true ); marker = createMarker( xv, yv +1, zv, "cylinder", 1, 255, 0, 0, 100 ); else outputChatBox("[invalidSyntax]:/makeveh [model], [tablename], [key]", thePlayer, 255, 0, 0) end end
-
Hmm, is there a way I could see the function's code? Maybe its able to rewrite etc.
-
Hey guys, I was wondering, how do you set the target of the camera to a ped Element? If thats even possible... I keep getting a false returned. Can it only be done with player elements?;o
-
look at this part of the code; engineApplyShaderToWorldTexture ( shader, "ws_Transfender_dirty" ) dxSetShaderValue ( shader, "gTexture", texture )
-
Hey guys, I'm creating a hunger system and this is how I'm working on it right now. The player logs in, and receives a hunger data, a timer will be created and he will lose hunger depending on his walking speed. My question is; I created the timer server sided, when a player logs or disconnects the timer gets destroyed. I've tested it with 1 other guy in my server. My timer goes forward but will this also continue if there are more then 2 players? this is the timer part; ... hungerTimer = setTimer(startHunger, 1000, 1, source); ... addEventHandler("onPlayerQuit", root, function () killTimer ( hungerTimer ); end );
-
No, just copy the code into a server sided .lua file and restart your source, it works fine like this.
-
http://up.ht/18rTdCh, there ya go.
