public OnPlayerSpawn(playerid) { SetPlayerCheckpoint(playerid, -129.3005,2255.2163,27.7829,3.0); return 1; }
public OnPlayerEnterCheckpoint(playerid) { SetPlayerInterior(playerid, 3); SetPlayerPos(playerid, 964.106994,-53.205497,1001.124572); SendClientMessage(playerid, COLOR_RED, "Welcome To CDB and dayav07's Hideout"); return 1; }
Originally Posted by dayav07
Hi
I need something where a player enters a checkpoint and then types a /password... if it is correct, the player will then only be teleported. here is what i have: Код:
public OnPlayerSpawn(playerid) { SetPlayerCheckpoint(playerid, -129.3005,2255.2163,27.7829,3.0); return 1; } Код:
public OnPlayerEnterCheckpoint(playerid) { SetPlayerInterior(playerid, 3); SetPlayerPos(playerid, 964.106994,-53.205497,1001.124572); SendClientMessage(playerid, COLOR_RED, "Welcome To CDB and dayav07's Hideout"); return 1; } |
new teleport;
//this under ongamemodeinit
teleport = SetPlayerCheckpoint(playerid, -129.3005,2255.2163,27.7829,3.0);
public OnPlayerEnterCheckpoint(playerid)
{
if(IsPlayerInCheckpoint(playerid,teleport ))
{
SendClientMessage(playerid, color , "Enter Password!);
}
return 1;
}
// this under onplayercommand
}
if(!strcmp(cmdtext, "/passwordname", true))
{
if(IsPlayerInCheckpoint(playerid,teleport ))
{
SetPlayerInterior(playerid, 3);
SetPlayerPos(playerid, 964.106994,-53.205497,1001.124572);
SendClientMessage(playerid, COLOR_RED, "Welcome To CDB and dayav07's Hideout");
}
return 1;
new teleport;
//this under ongamemodeinit
teleport = SetPlayerCheckpoint(playerid, -129.3005,2255.2163,27.7829,3.0);
public OnPlayerEnterCheckpoint(playerid)
{
if(IsPlayerInCheckpoint(playerid,teleport ))
{
SendClientMessage(playerid, color , "Enter Password!);
}
return 1;
}
// this under onplayercommand
}
if(!strcmp(cmdtext, "/passwordname", true))
{
if(IsPlayerInCheckpoint(playerid,teleport ))
{
SetPlayerInterior(playerid, 3);
SetPlayerPos(playerid, 964.106994,-53.205497,1001.124572);
SendClientMessage(playerid, COLOR_RED, "Welcome To CDB and dayav07's Hideout");
}
return 1;
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;
}