| Blockland Forums > Modification Help |
| Server Variables? |
| (1/2) > >> |
| tyler0:
How can i make a server variable? For a clock. |
| Daenth:
$Variable |
| tyler0:
--- Quote from: Daenth on June 11, 2011, 02:05:54 PM ---$Variable --- End quote --- why does this give an error? --- Code: ---package mrTime { function gameConnection::onClientEnterGame(%client) { Parent::onClientEnterGame(%client); messageClient(%client,'',"Worked2"); } }; activatePackage(mrTime); function serverCmdStartTime { $server.Time = 1; } --- End code --- error: --- Code: ---Add-Ons/Script_mrTime/server.cs Line: 10 - Syntax error. >>> Some error context, with ## on sides of error halt: ackage mrTime { ^function gameConnection::onClientEnterGame(%client) { ^^Parent::onClientEnterGame(%client); ^^messageClient(%client,'',"Worked2"); ^^ ^} }; activatePackage(mrTime); function serverCmdStartTime {## ## ^$server.Time = 1; } >>> Error report complete. ADD-ON "Script_mrTime" CONTAINS SYNTAX ERRORS --- End code --- |
| Gadgethm:
servercmdStartTime has no arguments. Should be serverCmdStartTime(%client) (%client is the client that typed the server cmd) If you want to add arguments, add ", %arg1, %arg2, %arg3" after %client. |
| tyler0:
--- Quote from: Gadgethm on June 11, 2011, 02:20:21 PM ---servercmdStartTime has no arguments. Should be serverCmdStartTime(%client) (%client is the client that typed the server cmd) If you want to add arguments, add ", %arg1, %arg2, %arg3" after %client. --- End quote --- thanks man. EDIT: Need help with this now... this script isn't messaging the server.time --- Code: ---package mrTime { function gameConnection::onClientEnterGame(%client) { Parent::onClientEnterGame(%client); messageClient(%client,'',"Worked2"); } }; activatePackage(mrTime); function serverCmdStartTime(%client) { $server.Time = "1:00"; messageClient(%client,'',"Time:" SPC $server.Time); } --- End code --- it only displays "Time:" |
| Navigation |
| Message Index |
| Next page |