Author Topic: playertype change function  (Read 5199 times)


hmm i get this error now ...
here's the code:
Code: [Select]
function KarambitImage::onMount(%this, %obj, %slot)
{
   if(%obj.client.team $= "Terrorists")
   {
      %obj.setDatablock("TerrorMKHoleBot");
   }
   else if(%obj.client.team $= "Counter-Terrorists")
   {
      %obj.setDatablock("IDFSoldierKHoleBot");
   }
   else
   {
      return error("Improper teams for this add-on");
   }
   %obj.hideNode("rHand");
}


Shouldn't you use the getteam(), as in %client.getteam() $=....http://www.speedtest.net/result/3912385154.png

Also, it seems like the return error doesn't get routed to propely. Could be just my sleepy head though.

Code: [Select]
{
   if(%obj.client.getTeam() $= "Terrorists")
   {
      %obj.setDatablock("TerrorMKHoleBot");
   }
   else if(%obj.client.getTeam() $= "Counter-Terrorists")
   {
      %obj.setDatablock("IDFSoldierKHoleBot");
   }
   else
   {
This is the code and it still won't work what should i do now .. ?

It's changedatablock, is it not?

setdatablock will do the same .. but i think the problem is here:
Code: [Select]
(%obj.client.getTeam() $=

Check to see if %obj.client is in fact a client at all by tossing an echo in your code.

So I was just being sleepy?

Nvm guys i got tired of this it's really hard for me :-/