27.07.2011, 15:42
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?
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?