| Blockland Forums > Modification Help |
| UI Name Table for playertypes? [Solved] |
| (1/4) > >> |
| Greek2me:
EDIT: Solved but highly inefficient. Please see this post: http://forum.blockland.us/index.php?topic=190126.msg5103849#msg5103849 solved So the client-sided UI Name Table has values for bricks, emitters, items, lights, music, and vehicles: --- Code: ---$uiNameTable["4x8F"] = "258"; $uiNameTable_Emitters["Arrow Stick"] = "1176"; $uiNameTable_Items["bow"] = "1182"; $uiNameTable_Lights["Blue Light"] = "1349"; $uiNameTable_Music["After School Special"] = "1483"; $uiNameTable_Vehicle["Ball"] = "1248"; --- End code --- This lets you find the IDs for those types of objects.. But what about playertypes? How would I get the playertype's ID from its name, client-side? |
| Lugnut:
tree()? also loop through serverconnection section? |
| Greek2me:
--- Quote from: Lugnut1206 on March 29, 2012, 08:40:02 PM ---tree()? also loop through serverconnection section? --- End quote --- Cool, I didn't know about tree() before. That's useful. I still didn't find anything about the playertype list though. |
| Greek2me:
I still need help with this. |
| Lugnut:
--- Code: ---function getPlayerData() { for(%i = 0; %i < serverconnection.getCount(); %i++) //For loop that will loop through every serverconnect object. { if(serverconnection.getObject(%i).ClassName $= "PlayerData" && serverconnection.getObject(%i).uiname !$= "") //if the serverconnection object is a player AND has a uiname { echo("Located PlayerData: " SPC serverconnection.getobject(%i) SPC serverconnection.getobject(%i).uiname); //do stuff continue; //skip the next 4 unneccesary lines of code, saving us basically no processing power! yay! } if(serverconnection.getObject(%i).ClassName $= "PlayerData") // comprable to above, except if it doesn't have a uiname, use the objects id. { echo("Located PlayerData: " SPC serverconnection.getobject(%i) SPC "ERROR: No UINAME defined. Using object ID."); } } } --- End code --- |
| Navigation |
| Message Index |
| Next page |