05.08.2010, 04:39
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.
Also can you make it as a DCMD please.
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;
}
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)
}
}
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;
}