Forum
CS2D Scripts Lua Scripts/Questions/HelpI didn't say you can write the value nil...
I just said you can let it look like nil with a string, it's something completely different.
And to the last thing: lol.
@All
I've got a question.
How can I check if a tile between two positions is a wall?
I know that I can calculate how far they are away from each other with math.sqrt:
1
math.sqrt((y-player(id,"y"))^2 + (x-player(id,"x"))^2)
1
2
2
x = 67 math.floor(x/32) -- 2
Like this:
1
2
3
4
5
6
2
3
4
5
6
if rot1 < rot2 + 20 and rot1 > rot2 - 20 then 	if math.sqrt((y-player(id,"y"))^2 + (x-player(id,"x"))^2) < 300 then 		--check if wall is there 			--code 	end end
thx a little
but do anybodie have a rp server and can i be a admin plss maby tere you can tell me more and plase i always wanted to be a admin
edited 3×, last 23.12.10 10:01:34 pm
Help yourself ;).
I guess there's no other way, other than what you said. Convert it from pixels to tiles(/32) and use tile(x,y,"wall").
Edit: btw, you dont really need to use math.floor, because it will round itself when you call tile(x,y,"wall") (not sure though) .
@DannyDeth:
to update (and display) hp of a player every 100ms is very inefficient. Just assign this to "hit" hook, because that's the only place where hp really changes. It will be more accurate and a little bit less lag
J.
This is my first big script so the error might be very big...
Its very long..
alir292 has written
can anyone plz tell me how to become ct admin ( and also what do i do with RP ACHIVE plz tell me by PM plzplzplz
in the rp lua file, find the "admin={#####,}"
and replace the 5 numbers with your USGN ID
if your lua file doesnt have that then it might have a separate .TXT file, just replace the existing USGN with your USGN ID
Dantes Inferno has written
can someone help me how do i put a picture in the signature box
OFF TOPIC!!!
Use [ img ] link [ /img ]
without the spaces.
Quote
My lua script won't work
This is my first big script so the error might be very big...
This is my first big script so the error might be very big...
The error shouldnt be big. Everywhere you put too less "end" they are needed for "elseif" and function closing also for every "if" and everywhere there are 2,3 of them while should be ~8 count everything.
------------------------------------------------------
Now My part :
How do i check if player has enough points then...
1
points[id]=points[id]-1
and player get credits well i know that part but i want
to make -points instead of money
1
if (player(id,"money")>14999) --Here has to be points instead of money
edited 1×, last 24.12.10 11:27:15 am
Could you explain a little better what you want to do? It is coming across that you want a point system that gives them credits for each point or something like that...
it checks if player id miney >14999 then he buys that and loses 15000 but this is money. How to do it for points ? i mean points[id]...
players cannot drop wrench.
ONLY WRENCH NOT OTHER
help me
@Batlaizys
Ok, so you have a table with each person's points, correct? So you want to know how to remove the credits when they spend in a shop? I will give you an example:
1
2
3
4
2
3
4
function trade(player_id, item_id) 	price = item_price[item_id] 	credits[player_id] = credits[player_id] - price end
credits[id]=credits[id]+200. Somthing like that, i dont know if this is right...
1
2
3
4
5
6
7
2
3
4
5
6
7
function exchange_mpoints_for_credits(id) 	if (mpoints[id] > 0) then 		credits[id] = credits[id] + ( mpoints[id] * 200 ) 	else 		msg(copyright.."2550000You have no MegaPoints to exchange for credits!") 	end end
i dont know how to make save system :S
i will save licences
pls use minute function
if rp_hplicence[id]== true or rp_hitlicence[id]== true or rp_buldlicence[id]== true or rp_license[id]==true or yourmon[id] >= 1 then
save =>>rp_hplicence[id]
save =>>rp_hitlicence[id]
save =>>rp_buldlicence[id]
save =>>yourmon[id]
save =>>rp_license[id]
pls help me...