Author Topic: Help to All - Official Topic  (Read 1104 times)

Ok, so on this topic, post your questions or post an answer.
Make sure to quote the question just so we have more idea of who you're responding to!
Please ask a question or answer a question.
Answering is greatly appreciated!

My question: Is there a typemask for a vehicle? If there is, what is it?

Quote
   function player::damage(%damagedObject, %damagerObject, %position, %damage, %damageType)
   {

      if(isObject(%damagedObject) && isObject(%damagedObject.client) && isObject(%damagedObject.client) && %damagedObject != %damagedObject && %damagedObject.getDamageLevel() + %damage < %damagedObject.getDatablock().maxDamage && CityRPdataData.getData(%damagedObject.client.bl_id).valueDemerits < $CityRPdata::demerits::wantedLevel && getWord(CityRPdataData.getData(%damagedObject.client.bl_id).valueJailData, 1) < 1)
      {
         %client = ((%damagedObject.getType() &
$typeMasks::vehicleObjectType) && isObject(%damagerObject.getControllingClient())) ? %damagerObject.getControllingClient() : %damagerObject.client;
         %Damagedclient = ((%damagedObject.getType() & $typeMasks::vehicleObjectType) && isObject(%damagedObject.getControllingClient())) ? %damagedObject.getControllingClient() : %damagedObject.client;
         //Remember, the damaged client might be in a vehicle while getting hurt!

         if(%damagedObject.getDamageLevel() + %damage < %damagedObject.getDatablock().maxDamage)
         {
             if(!%client.godmode)
             {
            commandToClient(%client, 'centerPrint', "\c6You have commited a crime. [\c3Attempted Murder\c6]", 1);
            
            %client.CityRP(2, $CityRPdata::demerits::attemptedMurder);
             }

             else if(%Damagedclient.godmode)
             {
            return;
             }


         }
      }
      
      parent::damage(%damagedObject, %damagedObject, %pos, %damage, %damageType);
   }
Think that's your answer.(CityRP)

Ok I've already asked these in my help topic, but I'll post it here just in case.
1. What is the function for dropping an item? Would %client.dropTool(); do anything?

2. Is there a way to detect the bounding box? Or even have the raycast hit the brick and manipulate the spawned item?

Ok I've already asked these in my help topic, but I'll post it here just in case.

1. No, but I think the answer to that was in your help topic.
2. Well, you could use some event functions E.G. setItem or setItemDirection or setItemPosition... but I don't think there's a typemask for the bounding box.

Only badspot can make something official on this site, Idiot.


The unofficial official topic.

^^ 3 idiots are above this post ^^

Whatever. Just get on topic.

D: I'm not an idiot, it's just a joke.

Ok, so on this topic, post your questions or post an answer.
Make sure to quote the question just so we have more idea of who you're responding to!
Please ask a question or answer a question.
Answering is greatly appreciated!
We have a whole section for this. It's called Coding Help.
We are able to make our own topics. Makes it easier to find answers this way.

How do I make a tank turret not rotate but still move up and down?

We have a whole section for this. It's called Coding Help.