I dont know where to put this bit of code
#1

Hello well i have this thing with IsPlayerInArea and i dont know where to put it

I pretty much want to check if a truck has not got a trailer attached to it and it enters a certain point it will respawn the truck...

Please help

pawn Код:
forward IsPlayerInArea(playerid, x1, x2, y1, y2);
pawn Код:
forward IsPlayerInArea(playerid, x1, x2, y1, y2);
public IsPlayerInArea(playerid,x1, x2, y1, y2)
{
    new Float:xx, Float:yy, Float:zz; GetPlayerPos(playerid, xx, yy, zz);
    if(xx > x1 && xx < x2 && yy > y1 && yy < y2) return 1;
    else return 0;
}
If you need any more code just ask

Please help

Thanks
Reply
#2

You need to put it in the fornt of the script.. Over all defines..
Reply
#3

Quote:
Originally Posted by farCry.xD
Посмотреть сообщение
You need to put it in the fornt of the script.. Over all defines..
I know that but where do i put it like for example would i do this

pawn Код:
OnPlayerStateChange(playerid, newstate, oldstate)
{
           if(IsPlayerInArea(playerid, x, x, y, y)
           {
                  // Code here
           }
}
If you need any more code just ask

Please help

Thanks
Reply
#4

outside of everything
Reply
#5

Quote:
Originally Posted by tyler12
Посмотреть сообщение
outside of everything
Yes... but where can i put the code to check if the player is in the area..
Reply
#6

You would have to get the minx maxx miny and maxy co-ordinates for the area you're checking if the player is in. I think you can use MapAndreas to aid you in doing that.
Reply
#7

Quote:
Originally Posted by Tee
Посмотреть сообщение
You would have to get the minx maxx miny and maxy co-ordinates for the area you're checking if the player is in. I think you can use MapAndreas to aid you in doing that.
I dont think any one knows what im trying to do

Pretty much where would i put this bit of code

pawn Код:
if(IsPlayerInArea(playerid, x, x, y, y)
{
        // Code here
}
Where abouts would i put that in what bit

OnPlayerStateChange

OnPlayerStateKeyChange

If you need any more code just ask

Please help

Thanks
Reply
#8

Scroll down to the button of the script, press enter 4 times and paste the code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)