[HELP] How do i make this one?
#1

Hi there,
I have a problem, I want to make this: (spoiler: this uses interriors)
If a player is in virtualworld number 1 and near point 756989,1240.000000,1082.149902
then when he pushes secondairy fire it makes him go to point 932.67,2215.2,11.48,225
And if a player is in virtualworld number 2 and near point 756989,1240.000000,1082.149902
then when he pushes secondairy fire it makes him go to point 967.43,2214.36,11.46

I know how to make this a little bit but i don't know how to insert the virtual world thingy
I have something like this:
pawn Код:
if (PlayerToPoint(3.0, playerid,756989,1240.000000,1082.149902))
            {
                   SetPlayerInterior(playerid,0);
                SetPlayerVirtualWorld(playerid,0);
                PlayerInfo[playerid][pInt] = 0;
                PlayerInfo[playerid][pLocal] = 255;
                          SetPlayerPos(playerid,932.67,2215.2,11.48,225);
if(HouseInfo[i][hHel] == 1)
                    {
                        new Float:tempheal;
                        GetPlayerHealth(playerid,tempheal);
                        if(tempheal < 100.0)
                        {
                            SetPlayerHealth(playerid,100.0);
                        }
                    }          
}
but where do i need to put the virtualworld is 1 or 2
Reply
#2

I dont think this solves your problem but im just going to say.
Use https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Its better and faster than PlayerToPoint
Reply
#3

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if(newkey & KEY_SECONDARY_ATTACK)
  {
    if(GetPlayerVirtualWorld(playerid) == puttheworldhere)
    {
      //code (range check)
    }
    else if(GetPlayerVirtualWorld(playerid) == putthesecondworldhere)
    {
      // code (range check)
    }
  }
  return 1;
}
Reply
#4

Quote:
Originally Posted by SAWC™
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if(newkey & KEY_SECONDARY_ATTACK)
  {
    if(GetPlayerVirtualWorld(playerid) == puttheworldhere)
    {
      //code (range check)
    }
    else if(GetPlayerVirtualWorld(playerid) == putthesecondworldhere)
    {
      // code (range check)
    }
  }
  return 1;
}
Thanks!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)