| Re: problem with lua scripts [message #412646 is a reply to message #412605] | 
			Sun, 29 November 2009 16:02    | 
		 
		
			
				
				
				  | 
					
						  
						Distrbd21
						 Messages: 743 Registered: September 2008 
						
	Karma: 
 
					 | 
					Colonel  | 
					 
  | 
		 
		 
	 | 
 
	
		| jnz wrote on Sun, 29 November 2009 11:38 |  
 | Hubba wrote on Sun, 29 November 2009 16:16 |   What version of lua do you use?  
 
If you use version 5 you have to change all the PiD's to PlayerId 
 
Like this: 
	if Message == "!b rail" then
               if Purchase_Item(Get_GameObj(PlayerId), 600) == 1 then
                  local pos = Get_Position(Get_GameObj(PlayerId))
                  Grant_Powerup(Get_GameObj(PlayerId), "POW_Railgun_Player")
            Grant_Powerup(Get_GameObj(PlayerId), "CnC_POW_Ammo_ClipMax")
            InputConsole("cmsg 0,230,57 [Weap-Bot]: %s has bought a railgun.", Get_Player_Name_By_ID(PlayerId))
               else
               InputConsole("ppage %d You Need 600 credits to buy this.", PlayerId)
            end
      end 
 
I don't know if the other one works. But do you have Misc.Ini file at this location LuaPlugins/Misc/Misc.ini? 
 
  |  
  
 
"Change all pIDs to PlayerIds"? This is not true at all, you can name the argument to any of the event functions (OnChat OnPlayerJoin etc) whatever you like. For example: 
function OnChat(theplayaidentifcationnumber, messagetype, themessage, themessagetarget)
end
  
  |  
  
i have tried to add that on chat thing but all it does is give me errors.
		
		
 
 Live Your Life Not Some one Else's.| Sharing Is Caring  
 
Cookie Jar<glome> Who stole the cookie from the cookie jar?! 
<content> glome stole the cookie from the cookie jar! 
<glome> Who me?! 
<content> Yes you! 
<glome> Couldn't be! 
<content> Then WHO?!! 
<glome> Woody stole the cookie from the cookie jar! 
*** glome has been kicked by DrWoody (fuck you i didn't touch the motherfucking cookie, bitch   
Suicide<TB>  I was depressed last night so I called the Suicide Life Line. 
<TB>  I reached a call center in Pakistan. 
<TB>  I told them I was suicidal. 
<TB>  They got all excited and asked if I could drive a truck  
		
 |  
	| 
		
	 | 
 
 
 |