Enter and Exit - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Enter and Exit (
/showthread.php?tid=165501)
Enter and Exit -
Luis_Leone - 05.08.2010
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.
Re: Enter and Exit -
Luis_Leone - 05.08.2010
Anyone wanna help?
Re: Enter and Exit -
Jeffry - 05.08.2010
Like /enter 1 /enter 2 ? Or what do you mean?
Re: Enter and Exit -
Luis_Leone - 05.08.2010
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?
Re: Enter and Exit -
Luis_Leone - 05.08.2010
I need help here
.
Re: Enter and Exit -
Jeffry - 05.08.2010
Please explain it better to me. I just don't get what you really want.
Re: Enter and Exit -
Kar - 05.08.2010
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
Re: Enter and Exit -
selten98 - 05.08.2010
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)
}
}
Re: Enter and Exit -
Jeffry - 05.08.2010
EDIT: Ah, okey. This makes sence now.
Re: Enter and Exit -
iggy1 - 05.08.2010
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)