Trying to make a password to enter a building - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Trying to make a password to enter a building (
/showthread.php?tid=272209)
Trying to make a password to enter a building -
Superrollo - 27.07.2011
Hi.
I have this pickup, and if you stand on it you will enter a building. Alot of fun, but now I'm trying to add a password to it.
This is what I had:
The command:
if (strcmp("/password", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 942.8, -1477.8, 12.5))
{
SendClientMessage(playerid, green, "You may proceed.");
SetPlayerPos(playerid, 942.97, -1478.07, 13.55);
}
else
{
SendClientMessage(playerid, red, "You're not near the entrance!");
}
return 1;
}
return 0;
}
The pickup:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == entrance) SendClientMessage(playerid, red, "Whats the password!");
The location of the pickup:
1239, 23, 942.97, -1478.07, 13.55, -1
Problem is: When I type the password on the pickup, it still says "You're not near the entrance!".
Soooo... What am I doing wrong here?
Re: Trying to make a password to enter a building -
iPLEOMAX - 27.07.2011
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 5, 942.8, -1477.8, 12.5))
You forgot the 'Range' parameter.
Re: Trying to make a password to enter a building -
Superrollo - 27.07.2011
Thanks man!