SA-MP Forums Archive
/enter command help - 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)
+--- Thread: /enter command help (/showthread.php?tid=390416)



/enter command help - Alyster - 06.11.2012

I'm new to scripting and just trying to script an /enter and /exit command command with zcmd for LV Planning Area to test my interior map. But I keep getting these two errors:

Код:
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
Could someone please let me know what I'm doing wrong. Here is the script:

PHP код:
CMD:enter(playeridparams[])
{
    
IsPlayerInRangeOfPoint(playerid1483.69995117,-1750.09997559,15.30000019);
    
SetPlayerPos(playerid1478.50000000,-1750.19995117,15.30000019);
    return 
1;
}
 
CMD:exit(playeridparams[])
{
    
IsPlayerInRangeOfPoint(playerid1478.50000000,-1750.19995117,15.30000019);
    
SetPlayerPos(playerid1483.69995117,-1750.09997559,15.30000019);
    return 
1;




Re: /enter command help - Glad2BeHere - 06.11.2012

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint

as u see u missed range
pawn Код:
//enter
IsPlayerInRangeOfPoint(playerid, 10,1483.69995117,-1750.09997559,15.30000019);

// exit
IsPlayerInRangeOfPoint(playerid,10, 1478.50000000,-1750.19995117,15.30000019);



Re: /enter command help - Alyster - 06.11.2012

Thank you sooo much! But now I have another problem I hope you'll know how to fix.

Everything is compiling perfectly and I'm able to use the command in game. But the problem is, I can use the command anywhere in game and it will teleport me to my location. Even if I'm on the other side of the game in another city, it still will teleport me to my coordinate. I don't understand why it's doing this since my player range is 3.0

PHP код:
CMD:enter(playeridparams[])
{
    
IsPlayerInRangeOfPoint(playerid3.01481.0547,-1772.0500,18.7958); //CityHallEntrance
    
SetPlayerPos(playerid384.808624,173.804992,1008.382812);
    
SetPlayerInterior(playerid3);
    return 
1;
}
 
CMD:exit(playeridparams[])
{
    
IsPlayerInRangeOfPoint(playerid3.0384.808624,173.804992,1008.382812);
    
SetPlayerPos(playerid1481.0547,-1772.0500,18.7958);
    
SetPlayerInterior(playerid0);
    return 
1;




Re: /enter command help - Glad2BeHere - 06.11.2012

pawn Код:
//for player in range of the point u want, correct coding

//enter
if(IsPlayerInRangeOfPoint(playerid, 10,1483.69995117,-1750.09997559,15.30000019))

// exit
if(IsPlayerInRangeOfPoint(playerid,10, 1478.50000000,-1750.19995117,15.30000019))
pawn Код:
//to do it anywhere, remove;

//enter
if(IsPlayerInRangeOfPoint(playerid, 10,1483.69995117,-1750.09997559,15.30000019))

// exit
if(IsPlayerInRangeOfPoint(playerid,10, 1478.50000000,-1750.19995117,15.30000019))



Re: /enter command help - RajatPawar - 06.11.2012

EDIT:Thanks GladToBeHere..


Re: /enter command help - Glad2BeHere - 06.11.2012

nope but u cant use
pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, distance,x,y,z)) return SendClientMessage(playerid, -1,"You are not near");



Re: /enter command help - Alyster - 06.11.2012

Quote:
Originally Posted by Glad2BeHere
Посмотреть сообщение
pawn Код:
//for player in range of the point u want, correct coding

//enter
if(IsPlayerInRangeOfPoint(playerid, 10,1483.69995117,-1750.09997559,15.30000019))

// exit
if(IsPlayerInRangeOfPoint(playerid,10, 1478.50000000,-1750.19995117,15.30000019))
pawn Код:
//to do it anywhere, remove;

//enter
if(IsPlayerInRangeOfPoint(playerid, 10,1483.69995117,-1750.09997559,15.30000019))

// exit
if(IsPlayerInRangeOfPoint(playerid,10, 1478.50000000,-1750.19995117,15.30000019))
I still can't seem to fix this, and I can't really find out the difference between your two code scripts you posted. Are you saying I need to change my /enter and /exit command to this?:


PHP код:
CMD:enter(playeridparams[])
{
    
IsPlayerInRangeOfPoint(playerid3,1481.0547,-1772.0500,18.7958); //CityHallEntrance
    
IsPlayerInRangeOfPoint(playerid,3384.808624,173.804992,1008.382812);
    return 
1;
}
CMD:exit(playeridparams[])
{
    
IsPlayerInRangeOfPoint(playerid3,384.808624,173.804992,1008.382812);
    
IsPlayerInRangeOfPoint(playerid,31481.0547,-1772.0500,18.7958);
    return 
1;

If so, these commands still don't work. Am I doing somthing wrong?