lua end map

Discussions about ET modding (sdk code, player/weapon modeling)

Moderators: Forum moderators, developers

User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post by Luk4ward »

gotenks wrote:but why do you have an if at all? it'd work the same if you removed the if statement all together, and just let the code execute,
just my stance against dirty programming
Because it will disable the callvote timelimit command for other than x values where x is below 0 or eq 0 or greater than 1, so dnt call it dirty programming 8)

Code: Select all

if &#40;timel <= 0&#41; or &#40;timel > 1&#41; then
                         et.trap_SendServerCommand&#40;cno, "cpm "^1You can vote only for end the map!\n"" &#41;
                              return 1
                             end 
wolFTeam.pl
McSteve
Posts: 113
Joined: Tue Sep 12, 2006 7:41 am

Post by McSteve »

To be fair to Gotenks, its not immediately obvious what is going on without carefully scrutinising all the code in this thread. Also if you are using timelimit 1 to end the map, then tbh you should be using:

Code: Select all

if time1 ~= 1 then
	et.trap_SendServerCommand&#40;cno, "cpm \"^1You can vote only for end the map!\n\"" &#41;
	return 1
end
/exit pedant mode
GhosT:McSteve
Ghostworks Gaming Community
User avatar
Luk4ward
Posts: 236
Joined: Sun Jul 30, 2006 1:55 pm
Location: Poland
Contact:

Post by Luk4ward »

U meant to be fair with English, coz the code is not complicated. He didnt just read it as my prev posts about the logical problem, but well spotted, i just copied the code from my other mod and merged into current problem.

/pedant mode is good ;p
wolFTeam.pl
Major Zeman
Posts: 16
Joined: Tue Mar 20, 2007 1:37 am
Location: Czech Republic
Contact:

Post by Major Zeman »

Damn real numbers, heh.

I too thought time was an intger and therefore the code was silly.
lua > me
Post Reply