Enter and Exit
#1

How can i make an /enter and /exit command, so i can put multiple X, Y and Z coords in them?
Also can you make it as a DCMD please.
Reply
#2

Anyone wanna help?
Reply
#3

Like /enter 1 /enter 2 ? Or what do you mean?
Reply
#4

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
Like /enter 1 /enter 2 ? Or what do you mean?
I mean, I want to make an enter command for PD and EMS but I only know how to do the enter command for PD?
Reply
#5

I need help here .
Reply
#6

Please explain it better to me. I just don't get what you really want.
Reply
#7

he wants. if u do /enter and ur at lspd u go in lspd if u do /enter u go in cj house etc.

i can make you one if u click enter and not type /enter u want that?

or

pawn Код:
if(strcmp(cmdtext, "/enter", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,3,x,y,z)
        {
            SetPlayerPos(playerid,x,y,z);
        }
        else if(IsPlayerInRangeOfPoint(playerid,3,x,y,z)
        {
            SetPlayerPos(playerid,x,y,z);
        }
        return 1;
    }
not the best way. but its ok
Reply
#8

pawn Код:
if(strcmp(cmd,"/enter",true) == 0)
{
  if(IsPlayerInRangeOfPoint(blabla))
  {
    SetPlayerPos(playerid,blablabla)
  }
  else if(IsPlayerInRangeOfPoint(blabla))
  {
     SetPlayerPos(playerid,blabla)
  }
}//rest of this is easy now...
if(strcmp(cmd,"/exit",true) == 0)
{
  if(IsPlayerInRangeOfPoint(blabla))
  {
    SetPlayerPos(playerid,blablabla)
  }
  else if(IsPlayerInRangeOfPoint(blabla))
  {
     SetPlayerPos(playerid,blabla)
  }
}
Reply
#9

EDIT: Ah, okey. This makes sence now.
Reply
#10

Heres a version using sscanf.
pawn Код:
dcmd_enter(playerid,params[])
{
    new tpid[16];//change if you need a bigger string. or smaller
    if(sscanf(params,"s",tpid))return SendClientMessage(playerid,0xff0000FF,"Error Usage: /enter <interiorname>");

    if(!strcmp(tpid,"lspd",true,4))//see if the string is lspd eg, /enter lspd
    {
        SetPlayerPos(playerid,x,y,z);//put ur co-ords here
        SetPlayerInterior(playerid,0);//swap '0' for the interior of your choice
        //other stuff
    }
    if(!strcmp(tpid,"ems",true,3))//see if strng is ems
    {
        //blahblah
    }
    return 1;
}
You will probably wana put other stuff lke setplayervirtualworld.(or maybe not)
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)