| Blockland Forums > Modification Help |
| messageclient(); does not work? |
| << < (5/6) > >> |
| deathrider:
--- Quote from: Nexus on April 08, 2012, 10:23:58 AM ---There are a couple of problems with this. You are getting your client side code and your server side code mixed up. This will only work if you are hosting a non-dedicated server. Also just stacking if statements for essentially the same test isn't the best way to do it. Other than that this should work fine. edit: oh also don't have a return before the parent::onconnect The parent should be the very first thing in this kind of function anyway. --- End quote --- but i have done the if statements right? alos how will it only work on a non dedi |
| Headcrab Zombie:
--- Quote from: deathrider on April 08, 2012, 09:30:14 AM ----snip- --- End quote --- First, work on indenting, one tab for each pair of brackets the line is between. Many text editors made for programming will do it for you automatically. Second, if your checking the value of a number, you don't enclose the number in quotes: if(%random == 1) not if(%random == "1") In this case it will work just fine, but it's a good idea to get in the habit of doing it properly |
| deathrider:
--- Quote from: Headcrab Zombie on April 08, 2012, 08:03:08 PM ---First, work on indenting, one tab for each pair of brackets the line is between. Many text editors made for programming will do it for you automatically. Second, if your checking the value of a number, you don't enclose the number in quotes: if(%random == 1) not if(%random == "1") In this case it will work just fine, but it's a good idea to get in the habit of doing it properly --- End quote --- im using notepad 2 but what about this not working on a dedicated server |
| deathrider:
found the error --- Code: ---commandtoserver('messagesent',"Hey " @ %name @ " how ya going.); --- End code --- see the end does not have an " edit: still says errors down at the parent |
| elm:
--- Quote from: deathrider on April 08, 2012, 08:12:28 PM ---found the error --- Code: ---commandtoserver('messagesent',"Hey " @ %name @ " how ya going.); --- End code --- see the end does not have an " edit: still says errors down at the parent --- End quote --- parent::onConnect(%client); |
| Navigation |
| Message Index |
| Next page |
| Previous page |