[HELP]How to make /enter /exit with zcmd - 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: [HELP]How to make /enter /exit with zcmd (
/showthread.php?tid=577650)
[HELP]How to make /enter /exit with zcmd -
JBee - 13.06.2015
Here's my IsPlayerInRangeOfPoint: IsPlayerInRangeOfPoint(playerid, 4.0, 2522.8105,-1679.3905,15.4970)) in i want to spawn in sweets house.
Re: [HELP]How to make /enter /exit with zcmd -
DarkLouis - 13.06.2015
PHP код:
CMD:enter(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 4.0, 2522.8105,-1679.3905,15.4970))
{
SetPlayerPos (playerid, x, y, z);
SetPlayerInterior (playerid, interior);
}
else SendClientMessage (playerid, -1, "You must stay near a door");
return 1;
}
CMD:exit(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 4.0, x, y, z))
{
SetPlayerPos (playerid, 2522.8105, -1679.3905, 15.4970);
SetPlayerInterior (playerid, 0);
}
else SendClientMessage (playerid, -1, "You must stay near a door");
return 1;
}
Re: [HELP]How to make /enter /exit with zcmd -
NoDi522 - 13.06.2015
PHP код:
CMD:enter(playerid,params[])
{
// First line: We are checking if here IS NOT near the entrance and if we confirm that we return him message.
if(!IsPlayerInRangeOfPoint(playerid,4.0,2522.8105,-1679.3905,15.4970)) return SendClientMessage(playerid,-1,"ERROR: You are not near the entrance");
else // else if he is near the entrance...
{
SetPlayerPos(playerid,2527.654052,-1679.388305,1015.498596); // Setting position..
SetPlayerInterior(playerid,1); // ... And interior. DONE!
}
return 1;
}
CMD:exit(playerid,params[])
{
// Here we have done the same thing just changed the coordinates.
if(!IsPlayerInRangeOfPoint(playerid,4.0,2527.654052,-1679.388305,1015.498596)) return SendClientMessage(playerid,-1,"ERROR: You are not near the exit");
else
{
SetPlayerPos(playerid,2522.8105,-1679.3905,15.4970);
SetPlayerInterior(playerid,0);
}
return 1;
}