Author Topic: Image tag code  (Read 1218 times)

Heyo,

Im trying to toggle an image to pop up when a command is put into the server. Can someone help me figure out what is wrong with the tag

Code: [Select]
function serverCmdMap(%client, %name)

{
messageClient(%client, '', <bitmap:/images/map.png>;

}

Code: [Select]
function serverCmdMap(%client, %name)
{
messageClient(%client, '', "<bitmap:/images/map.png>");
}
You were missing the quotations for the actual message argument, which is the bitmap, and also missing a closing bracket for the function. Keep in mind that this will look for <blockland-directory>/images/map.png, so if you don't have the images folder or the map.png image, it will spew a bunch of errors in the console.

Also keep in mind that messageClient is for chat messages, so the map image will appear in the chat. If you wanted it to appear in the center, you could use %client.centerPrint(%message, %time);

for bitmaps you must have the full file location, otherwise it'll do this: Blockland//images/map.png



What are you using to edit the code?

I recommend sublime text, it's very neat and you can have custom syntaxes.
« Last Edit: April 24, 2017, 04:59:20 PM by Kyuande »

for bitmaps you must have the full file location, otherwise it'll do this: Blockland//images/map.png



What are you using to edit the code?

I recommend sublime text, it's very neat and you can have custom syntaxes.



I use notepad++

So here is the new code I have.

Code: [Select]
function servercmdMaps(%client, %name)
{
%client.centerPrint("<bitmap:Add-ons/Gamemode_AmusementPark/images/map.png>", 6);
}

I can't get this one to work, however I can get this one too however it is small.


Code: [Select]
function serverCmdMap(%client, %name)
{
messageClient(%client, '', "<bitmap:Add-ons/Gamemode_AmusementPark/images/map.png>");
}

Increase the size of your bitmap/image.

Have it something like 50x50

try centerprint(%client, msg, time);