06.07.2012, 21:50
Before I start this, I would like to say Hello, Im a new scripter and hope to script my own server soon
Alrighty so heres my problem, Im attempting to make a enterance to a door, but it only seems to work in only one specific spot (Ex. Jizzy's club only, or the Police Department), So if you guys can, might you show me how to make many entrances? Thanks!
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/enter", cmdtext, true, 6) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,3.0, -2624.3667,1411.8839,7.0938 ))
{
SetPlayerPos(playerid,-2640.762939,1406.682006,906.460937);
SetPlayerInterior(playerid, 3);
SetPlayerFacingAngle(playerid, 90.9048 );
SetCameraBehindPlayer(playerid);
}
else SendClientMessage(playerid, COLOR_WHITE, "You need to be near an entrance!");
}
return 1;
}
//This is the one that does not work, even If I change the Coordinates.
if(strcmp("/enter", cmdtext, true, 6) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,3.0, -2624.3667,1411.8839,7.0938 ))
{
SetPlayerPos(playerid,-2640.762939,1406.682006,906.460937);
SetPlayerInterior(playerid, 3);
SetPlayerFacingAngle(playerid, 90.9048 );
SetCameraBehindPlayer(playerid);
}
else SendClientMessage(playerid, COLOR_WHITE, "You need to be near an entrance!");
}
return 1;
}
if(strcmp("/exit", cmdtext, true, 5) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,5.0, -2640.762939,1406.682006,906.460937))
{
SetPlayerPos(playerid,-2624.3667,1411.8839,7.0938 );
SetPlayerInterior(playerid, 0);
SetPlayerFacingAngle(playerid, 195.0774);
SetCameraBehindPlayer(playerid);
}
else SendClientMessage(playerid, COLOR_WHITE, "You need to be near an exit!");
}
return 1;
}
Alrighty so heres my problem, Im attempting to make a enterance to a door, but it only seems to work in only one specific spot (Ex. Jizzy's club only, or the Police Department), So if you guys can, might you show me how to make many entrances? Thanks!
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/enter", cmdtext, true, 6) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,3.0, -2624.3667,1411.8839,7.0938 ))
{
SetPlayerPos(playerid,-2640.762939,1406.682006,906.460937);
SetPlayerInterior(playerid, 3);
SetPlayerFacingAngle(playerid, 90.9048 );
SetCameraBehindPlayer(playerid);
}
else SendClientMessage(playerid, COLOR_WHITE, "You need to be near an entrance!");
}
return 1;
}
//This is the one that does not work, even If I change the Coordinates.
if(strcmp("/enter", cmdtext, true, 6) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,3.0, -2624.3667,1411.8839,7.0938 ))
{
SetPlayerPos(playerid,-2640.762939,1406.682006,906.460937);
SetPlayerInterior(playerid, 3);
SetPlayerFacingAngle(playerid, 90.9048 );
SetCameraBehindPlayer(playerid);
}
else SendClientMessage(playerid, COLOR_WHITE, "You need to be near an entrance!");
}
return 1;
}
if(strcmp("/exit", cmdtext, true, 5) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,5.0, -2640.762939,1406.682006,906.460937))
{
SetPlayerPos(playerid,-2624.3667,1411.8839,7.0938 );
SetPlayerInterior(playerid, 0);
SetPlayerFacingAngle(playerid, 195.0774);
SetCameraBehindPlayer(playerid);
}
else SendClientMessage(playerid, COLOR_WHITE, "You need to be near an exit!");
}
return 1;
}