-
Posts
2,947 -
Joined
-
Last visited
Everything posted by JR10
-
There is a function for it. bool resetTimer ( timer theTimer )
-
He said it works i thought it won't because it's for tables so anyway it should be string.len.
-
Hmm, i am not sure but i think that won't work here: string.len('gta')
-
Oh i forgot addEventHandler('onResourceStart', resourceRoot, function() for i,v in ipairs(getElementsByType('player')) do setElementData(v, 'canPlay', true) end end ) addEventHandler('onPlayerJoin', root, function() setElementData(source, 'canPlay', true) end )
-
No, he want it to spawn at creation position.
-
I have like 1000 txd file or even more i had to make a meta more than 1000 line to put them And now i have to load and import them OMG! How come on i am a human and i want to do it so bad and i have to copy it's name and find it in IDE !! Is there like a model generator or engineLoadTxd and engineImportTXD generator. Thanks in advance.
-
What the hell is this here: function taskagitmakas ( player, command, tkm ) if getElementData(player, 'canPlay') then local rand = math.random(0,2) local playing = nil if tkm == 'rock' then playing = 'rock' elseif tkm == 'paper' then playing = 'paper' elseif tkm == 'scissors' then playing = 'scissors' end if rand == 0 and tkm == 'rock' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played "..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played rock !" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Draw!" ,getRootElement(),0,255,0,true) end if rand == 0 and tkm == 'scissors' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played "..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played rock!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner"..getPlayerName(player) ,getRootElement(),0,255,0,true) end if rand == 0 and tkm == 'paper' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played "..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played rock!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner CPU!" ,getRootElement(),0,255,0,true) end if rand == 1 and tkm == 'rock' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played "..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played paper!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner CPU!" ,getRootElement(),0,255,0,true) end if rand == 1 and tkm == 'scissors' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played "..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played paper!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner"..getPlayerName(player), getRootElement(),0,255,0,true) end if rand == 1 and tkm == 'paper' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played "..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played paper!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Draw!" ,getRootElement(),0,255,0,true) end if rand == 2 and tkm == 'rock' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played "..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner"..getPlayerName(player), getRootElement(),0,255,0,true) end if rand == 2 and tkm == 'scissors' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played "..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Draw" ,getRootElement(),0,255,0,true) end if rand == 2 and tkm == 'paper' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played "..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner CPU!" ,getRootElement(),0,255,0,true) end end setElementData(player, 'canPlay', false) setTimer(setElementData, 60000, 1, player, 'canPlay', true) else outputChatBox('You have to wait 1 minute before you play again', player) end addCommandHandler ( "tkm", taskagitmakas ) Why is the onPlayerChat thing?
-
Ok so you want the player to use it once then a 60 seconds timer start ok do this use setElementData --at the start of your command do this if getElementData(player, 'canPlay') then --the command code --at the end of the command setElementData(player, 'canPlay', false) setTimer(setElementData, 60000, 1, player, 'canPlay', true)
-
There are more than one way to do it maybe this function taskagitmakas ( player, command, tkm ) local rand = math.random(0,2) local playing = nil if tkm == 'rock' then local playing = 'rock' elseif tkm == 'paper' then local playing = 'paper' elseif tkm == 'scissors' then local playing = 'scissors' end if rand == 0 and tkm == 'rock' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." has played#00cc00"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played rock !" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Draw!" ,getRootElement(),0,255,0,true) end if rand == 0 and tkm == 'scissors' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played rock!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner"..getPlayerName(player) ,getRootElement(),0,255,0,true) end if rand == 0 and tkm == 'paper' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played rock!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner CPU!" ,getRootElement(),0,255,0,true) end if rand == 1 and tkm == 'rock' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played paper!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner CPU!" ,getRootElement(),0,255,0,true) end if rand == 1 and tkm == 'scissors' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played paper!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner"..getPlayerName(player), getRootElement(),0,255,0,true) end if rand == 1 and tkm == 'paper' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played paper!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Draw!" ,getRootElement(),0,255,0,true) end if rand == 2 and tkm == 'rock' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner"..getPlayerName(player), getRootElement(),0,255,0,true) end if rand == 2 and tkm == 'scissors' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Draw" ,getRootElement(),0,255,0,true) end if rand == 2 and tkm == 'paper' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner CPU!" ,getRootElement(),0,255,0,true) end removeCommandHandler( "tkm", taskagitmakas ) setTimer(addCommandHandler, 60000, 1, taskagitmakas ) end addCommandHandler ( "tkm", taskagitmakas )
-
local rand = math.random(0,2) local playing = nil if tkm == 'rock' then playing = 'rock' elseif tkm == 'paper' then playing = 'paper' elseif tkm == 'scissors' then playing = 'scissors' end
-
Dude why did you double post and the same message function taskagitmakas ( player, command, tkm ) local rand = math.random(0,2) local playing = nil if tkm == 'rock' then local playing = 'rock' elseif tkm == 'paper' then local playing = 'paper' elseif tkm == 'scissors' then local playing = 'scissors' end if rand == 0 and tkm == 'rock' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." has played#00cc00"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played rock !" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Draw!" ,getRootElement(),0,255,0,true) end if rand == 0 and tkm == 'scissors' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played rock!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner"..getPlayerName(player) ,getRootElement(),0,255,0,true) end if rand == 0 and tkm == 'paper' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played rock!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner CPU!" ,getRootElement(),0,255,0,true) end if rand == 1 and tkm == 'rock' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played paper!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner CPU!" ,getRootElement(),0,255,0,true) end if rand == 1 and tkm == 'scissors' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played paper!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner"..getPlayerName(player), getRootElement(),0,255,0,true) end if rand == 1 and tkm == 'paper' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played paper!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Draw!" ,getRootElement(),0,255,0,true) end if rand == 2 and tkm == 'rock' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner"..getPlayerName(player), getRootElement(),0,255,0,true) end if rand == 2 and tkm == 'scissors' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Draw" ,getRootElement(),0,255,0,true) end if rand == 2 and tkm == 'paper' then outputChatBox("Rock,Paper,Scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#cc0000"..getPlayerName(player).." #00cc00has played"..playing.."!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00CPU played scissors!" ,getRootElement(),0,255,0,true) outputChatBox("#00cc00Winner CPU!" ,getRootElement(),0,255,0,true) end end addCommandHandler ( "tkm", taskagitmakas )
-
here u defined playing as nil local playing = nil and it wont change because your if is wrong if tkm == rock then local playing = rock elseif tkm == paper then local playing = paper elseif tkm == scissors then local playing = scissors end when a player types something its a string so it should be if tkm == 'rock' then local playing = 'rock' elseif tkm == 'paper' then local playing = 'paper' elseif tkm == 'scissors' then local playing = 'scissors' end
-
Post the error, and post the line.
-
Ok, then are you using a map file or... any way do this bool setVehicleRespawnPosition ( vehicle theVehicle, float x, float y, float z, [float rx, float ry, float rz ] ) use it onresourcestart and set the respawn position to the creation position.
-
respawnVehicle(ewvehicle) respawn vehicle will spawn it in the creation position
-
I use ' ' so When i wanted to use a word like "can't" i had to escape it like this 'can\'t' so that's it? that's the escape? and in your example above testName = '[FP]FatPony' newName = string.gsub(testName, '\[FP\]', '') -- and the name now is: atony Am i right?
-
1 question why you use % before each [ or | or ( else i understand. thanks btw i learned something new
-
So i can use this if string.find('mtaft', '[mta]', 0) will it find mta ?
-
I can't understand any thing of this: newn:find("[%[%(%|][fF][pP][%]%)%|]*") newPlayerName = playerName:gsub("[%[%(%|][fF][pP][%]%)%|]*", "") i just don't understand those patterns.
-
Exactly, oynanan is not defined.
-
where is 'oynanan' defined and post the errors
-
function taskagitmakas ( player, commandName, tkm ) local rand = math.random(0,2) local oynanan = bilinmeyen if tkm == tas then local oynanan = tas elseif tkm == kagit then local oynanan = kagit elseif tkm == makas then local oynanan = makas end
-
local playerName = getPlayerName(player) newPlayerName = playerName:gsub('[FP]', '') setPlayerName(player, newPlayerName)
