Enter points? - 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 points? (
/showthread.php?tid=403147)
Enter points? -
Lynet - 29.12.2012
Hello, can someone please give me e a example how i can make a enterable 24/7 shop?
I got this coords
PHP код:
2424.2573,-1742.7698,13.5461,227.5945
Thats is a enter point for a 24/7 shop. Please someone give me a example?
Re: Enter points? -
CBCandyBoy - 29.12.2012
what u want a pickup or something else
Re: Enter points? -
Lynet - 29.12.2012
No just simple when you are inrange of that point then you are able to /enter when you inside you're able to /exit
Re: Enter points? -
CBCandyBoy - 29.12.2012
ok will this work there is a down arrow when player walks on it will be written type/enter if he types enter person will be teleported to 24/7
Re: Enter points? -
CBCandyBoy - 29.12.2012
i think you must read this
https://sampforum.blast.hk/showthread.php?tid=330001
ok
Re: Enter points? -
Zex Tan - 29.12.2012
Quote:
Originally Posted by Lynet
Hello, can someone please give me e a example how i can make a enterable 24/7 shop?
I got this coords
PHP код:
2424.2573,-1742.7698,13.5461,227.5945
Thats is a enter point for a 24/7 shop. Please someone give me a example?
|
https://sampforum.blast.hk/showthread.php?tid=330001
Learn from it, there is lots of tutorials of this . Try to search using ****** next time
Re: Enter points? -
Lynet - 29.12.2012
I already did, and i made it, but u can /enter every where.
Re: Enter points? -
Vlad64 - 29.12.2012
This is a simple /enter /exit command for 24/7...
Add this above OnGameModeInit
Quote:
stock IsPlayerAtShop(playerid)
{
if (IsPlayerInRangeOfPoint(playerid,10,2424.2573,-1742.7698,13.5461)) return 1;
return 0;
}
stock IsPlayerInShop(playerid)
{
if (IsPlayerInRangeOfPoint(playerid,10,-31.0000000,-91.0000000,1003.2000122)) return 1;
return 0;
}
|
And this OnPlayerCommandText
Quote:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/enter", cmdtext, true, 10) == 0)
{
if (!IsPlayerAtShop(playerid)) return SendClientMessage(playerid,0xFFC800FF,"You are not near a 24/7!");
SetPlayerInterior(playerid, 18);
SetPlayerPos(playerid, -31.0000000,-91.0000000,1003.2000122);
return 1;
}
if (strcmp("/exit", cmdtext, true, 10) == 0)
{
if (!IsPlayerInShop(playerid)) return SendClientMessage(playerid,0xFFC800FF,"You are not in a 24/7!");
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 2424.2573,-1742.7698,13.5461);
return 1;
}
return 0;
}
|
or with zcmd include( Below #include <a_samp> add #include <zcmd> )... Add this below the stock functions
Quote:
CMD:enter (playerid)
{
if (!IsPlayerAtShop(playerid)) return SendClientMessage(playerid,0xFFC800FF,"You are not near a 24/7!");
SetPlayerInterior(playerid, 18);
SetPlayerPos(playerid, -31.0000000,-91.0000000,1003.2000122);
return 1;
}
CMD:exit (playerid)
{
if (!IsPlayerInShop(playerid)) return SendClientMessage(playerid,0xFFC800FF,"You are not in a 24/7!");
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 2424.2573,-1742.7698,13.5461);
return 1;
}
|
Re: Enter points? -
Konstantinos - 29.12.2012
Quote:
Originally Posted by Lynet
I already did, and i made it, but u can /enter every where.
|
IsPlayerInRangeOfPoint