I know it's not a complete explanation (but I'm now on ipad) (I apologies):
Using (zcmd)
PHP код:
//using (zcmd)
CMD:enter(playerid, params[])// /exit is the same idea
{
if(IsPlayerInRangeOfPoint(playerid, radius, x, y, z))//if player near a specific point (Note:You get the cords)
{
SetPlayerPos(playerid, x, y, z);//The other cords (where he will be teleported
SetPlayerInterior(playerid, interior);//set the interior of the cords
SetPlayerVirtualWorld(playerid, world);//Set the virtual world, if needed, it's according to you
}
else {//if player isn't near this point
SendClientMessage(playerid, .color = -1, "Your Message");
}
return 1;
}
Using (strcmp)
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/enter", cmdtext, true) == 0)//using strcmp
{
if(IsPlayerInRangeOfPoint(playerid, radius, x, y, z))//if player near a specific point (Note:You get the cords)
{
SetPlayerPos(playerid, x, y, z);//The other cords (where he will be teleported
SetPlayerInterior(playerid, interior);//set the interior of the cords
SetPlayerVirtualWorld(playerid, world);//Set the virtual world, if needed, it's according to you
}
else {//if player isn't near this point
SendClientMessage(playerid, .color = -1, "Your Message");
}
return 1;
}
return 0;
}
Edit: if you don't know how to get the cords, (This steps must be occured while on foot, to get accurate pos.)
1- Go ingame, go where you want the position
2- And There type /save [name]
3-open C:\Users\<you>\Documents\GTA San Andreas User Files\SAMP , double click on savedpositions.text
4- you will find your saved cords plus beside it, the name you saved too
5- so to figure out the X,Y,Z >> AddPlayerClass(skin, X,Y,Z,Angle,weap1,ammo1,weap2,ammo2,weap3,ammo3);
6- Copy the X-Y-Z (and that's it, pretty easy)
Further Explain:
We used above : IsPlayerInRangeOfPoint , we use this function to determine if the player is in the specific cords we put-in...
:
SetPlayerPos , it's very useful for "teleporting" players from a place to another and with the help of :
SetPlayerInterior , it solves a lot of in game visions.
(
SetPlayerFacingAngle) <<will help you a lot