23.09.2009, 17:09
Have you thought of use /password command with parameters? I would do it in dcmd
For example:
In this example, a player will be teleported to the hideout, if he writes /password Example and if he's in the checkpoint
Of course Example can be changed for any other string (but remember to change value of 7 in second condition - length of your password string)
For example:
pawn Код:
dcmd_password(playerid, params[])
{
if (IsPlayerInCheckpoint(playerid) == 0) SendClientMessage(playerid, COLOR_RED, "You must be in the checkpoint to use this command");
else
{
if (strlen(params) == 0) SendClientMessage(playerid, COLOR_RED, "Usage: /password [password]");
else
{
if ((strmid(params, "Example", false) && (strlen(params) == 7))
{
SetPlayerInterior(playerid, 3);
SetPlayerPos(playerid, 964.106994, -53.205497, 1001.124572);
SendClientMessage(playerid, COLOR_RED, "Welcome To CDB and dayav07's Hideout");
}
else SendClientMessage(playerid, COLOR_RED, "Incorrect password!");
}
}
return 1;
}
Of course Example can be changed for any other string (but remember to change value of 7 in second condition - length of your password string)