17.11.2012, 05:14
I wanted to create this heal command thing. But not like /heal and you are healed. I want to do this in strcmp. So, I will use the function OnPlayerEnterVehicle. When the player enters the vehicle, ambulance, a message will come out and say to type in /heal to heal himself. So at the command create part I do this:
I have created the command, how do I make it detect whether the player is in the ambulance and then it will proceed with the healing? Something like IsPlayerInRangeOfPoint. I tried OnPlayerStateChange, and to make the health regenerate when the players enter's the ambulance. It worked but then I later noticed that in every other vehicle I entered, my health will also be regenerated. So it was an epic FAIL! so I thought of just creating a simple /heal cmd and it will execute if the player is in the ambulance. (No matter Driver or Passenger.) Can someone help me out?
Код:
if(!strcmp(cmdtext, "/heal", true)) { (What do I put here?)