Raised This Month: $51 Target: $400
 12% 

warning 217: loose indentation & say commands


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Duo
Junior Member
Join Date: Sep 2004
Old 09-13-2004 , 22:00   warning 217: loose indentation & say commands
Reply With Quote #1

Just finished writing another a moneyscript (Im very original) and got it compiling with out errors. However, i have like 7 of these warnings.

warning 217: loose indentation

I moved things togeather and apart yet no avil.

if(read_argc() == 0) { // Reads arguments

or

cs_set_user_money (id , 16000,1 )

There is an example of 2 i have, if you can point me in the right direction im sure i can find out the rest.

Also, while my script picks thing up out of the console, i like to be lazy, and so do other people who play where i do, so i want my script to pick up out of console.

register_concmd("say /givemoney","give_cash",-1,"Gives $16000 to the person")

I was hoping it would pick up on it in the console, so i could type

/givemoney Addict

for example, when i type /givemoney with out a name my debug kicks in and says that it wants a user, but if i add a name it just sort if ignores it and uses it as say. however, if i use it through the console it works like a charm. Thanks, i want to make sure my scripts dont suck before posting them for public consumption.
Duo is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 09-14-2004 , 03:21  
Reply With Quote #2

loose identation just weans that the code isn't tabbed correctly,
show your plugin and i'll help you with that and your other problem.
FeuerSturm is offline
Duo
Junior Member
Join Date: Sep 2004
Old 09-14-2004 , 10:58  
Reply With Quote #3

Quote:
Originally Posted by FireStorm
loose identation just weans that the code isn't tabbed correctly,
show your plugin and i'll help you with that and your other problem.
Sweet, ill post it up as soon as i get home.
Duo is offline
Duo
Junior Member
Join Date: Sep 2004
Old 09-14-2004 , 16:04   The Code
Reply With Quote #4

Here is the code

Code:
/* 
Money Refill Script
Player just has to type amx_givemoney and the script should change their total to $16000
Script by Duo/Addict

Verson 0.1
First verson, a few warnings but nothing that really effects the script
*/

#include <amxmodx>
#include <cstrike>


new user[32]
new personid
new bool:MoneyEnabled = true 




public plugin_init() { // This will start the plugin
	
	register_plugin("Givemoney", ".01", "Duo/Addict")  // Tells server the command exists
	register_concmd("amx_givemoney","give_cash",-1,"Gives $16000 to the person") // Registers the command with AMX
	register_concmd("amx_takemoney","take_cash",ADMIN_KICK,"Gives this person $800") 
	register_concmd("amx_moneyrefill","money_toggle",ADMIN_KICK,"Turns money on and off")
register_concmd("say /givemoney","give_cash",-1,"Gives $16000 to the person") // Registers the command with and
register_concmd("say /takemoney","take_cash",-1,"Gives this person $800")     // Makes it work with say 
  register_concmd("amx_moneyrefill", "money_toggle",ADMIN_KICK,"Enables Script")
  
}

public money_toggle(id) {
	if (MoneyEnabled == true) {
		MoneyEnabled = false
		console_print(id,"Money Refill has been turned off")
		client_cmd(id,"echo The Bank is Closed, no more money free money :( ")
		return PLUGIN_HANDLED
	}
	if (MoneyEnabled == false) {
		MoneyEnabled = true
		console_print(id,"The bank is open, money for all")
		return PLUGIN_HANDLED
		client_cmd(id,"echo The Bank is Open for Biz, type amx_givemoney (name) in console to get $16000")
	}
}
	
	
public give_cash(id) { //Decalre public function
	
 if (MoneyEnabled == false) {
 	console_print(id, "The Money Refill isnt turned on, type amx_moneyrefill to toggle on and off")
 	return PLUGIN_HANDLED
 }
 
	
	if(read_argc() == 0) { // Reads arguments
		console_print(id,"You must give me a user to give money to")
		return PLUGIN_HANDLED
		
	}
	

	read_argv(1,user,32) // First argument, insert to variable, max length
	personid = find_player("bh",user)
	
	
if (personid == 0) {
	console_print(id,"Person dosnt exist ")
   return PLUGIN_HANDLED
  }


		
	cs_set_user_money (id , 16000,1 )
	console_print(id,"You now have more money, you owe me dude")
	client_cmd(personid, "say I just got $16000 so i could by another AWP!")
	return PLUGIN_HANDLED
	
}

// This part takes the cash down to $0
public take_cash(id) { 
	
	 if (MoneyEnabled == false) {
	 	console_print(id, "The Money Refill isnt turned on, type amx_moneyrefill to toggle on and off")
 	return PLUGIN_HANDLED
 }
 
	
	if(read_argc() == 0) {
		console_print(id,"You must give me a user to give money to")
		return PLUGIN_HANDLED
		
	}
	

	read_argv(1,user,32)
	personid = find_player("bh",user)
	
	
if (personid == 0) {
	console_print(id,"Person dosnt exist ")
   return PLUGIN_HANDLED
  }


		
	cs_set_user_money (id , 0,1 )
	console_print(id,"Some one haxored your bank account and took your money")
	client_cmd(personid, "say I just donated all my money to Jesus!")
	return PLUGIN_HANDLED
	
}
Duo is offline
mahnsawce
Senior Member
Join Date: Apr 2004
Location: internet
Old 09-14-2004 , 16:14  
Reply With Quote #5

The simplest fix for "loose indentation" warnings is to add this line right before your first #include:

Code:
#pragma tabsize 0
Technically this doesn't fix the problem, it just tells the compiler to shut up about that specific warning. But, the warning is absolutely retarded to begin with, so it's not like it matters =/
mahnsawce is offline
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 09-14-2004 , 16:16  
Reply With Quote #6

aww mahnsawce thats mean.. poor compiler... its not its fault people use spaces instead of tabs
Da Bishop is offline
Send a message via MSN to Da Bishop
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 09-14-2004 , 17:07  
Reply With Quote #7

Quote:
Originally Posted by Da Bishop
aww mahnsawce thats mean.. poor compiler... its not its fault people use spaces instead of tabs
Yes. It is.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Duo
Junior Member
Join Date: Sep 2004
Old 09-14-2004 , 17:29  
Reply With Quote #8

Quote:
Originally Posted by mahnsawce
The simplest fix for "loose indentation" warnings is to add this line right before your first #include:

Code:
#pragma tabsize 0
Technically this doesn't fix the problem, it just tells the compiler to shut up about that specific warning. But, the warning is absolutely retarded to begin with, so it's not like it matters =/
That shut it up, awesome!

Still, any tips to why the say /commands wont work?
Duo is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode