14.07.2011, 13:42
(
Последний раз редактировалось Gramercy Riffs; 14.07.2011 в 15:18.
)
I basically have two /enter and /exit commands for separate icons. However, when I /enter at one icon, I teleport too the interior for the other icon and when I exit that interior, I go to the actual exit point.
Could anyone shed some light on this please? Thank you.
Second enter filterscript:
Could anyone shed some light on this please? Thank you.
pawn Код:
#include <a_samp>
new infopickup;
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
infopickup = CreatePickup(1239,1,2845.8962,1943.3711,10.8203);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[]) {
if (strcmp("/valley", cmdtext, true, 6) == 0)
{
if(PlayerToPoint(10,playerid,2845.8962,1943.3711,10.8203))
{
SetPlayerPos(playerid,-0.4147,2515.5640,16.4844);
return 1;
}
return 0;
}
if (strcmp("/braxton", cmdtext, true, 6) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,10.0,-0.4147,2515.5640,16.4844))
{
SetPlayerPos(playerid,2845.8962,1943.3711,10.8203);
return 1;
}
}
return 0;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == infopickup)
{
GameTextForPlayer(playerid,"~g~ Paradise Valley",3000,1);
}
return 1;
}
stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx - x);
tempposy = (oldposy - y);
tempposz = (oldposz - z);
if(((tempposx < radi)&& (tempposx > - radi))&& ((tempposy < radi)&& (tempposy > - radi))&& ((tempposz < radi)&& (tempposz > - radi)))
{
return 1;
}
}
return 0;
}
Second enter filterscript:
pawn Код:
#include <a_samp>
new infopickup;
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
infopickup = CreatePickup(1239,1,2866.9751,1818.5575,11.0125);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[]) {
if (strcmp("/enter", cmdtext, true, 6) == 0)
{
if(PlayerToPoint(10,playerid,2866.9751,1818.5575,11.0125))
{
SetPlayerPos(playerid,322.197998,302.497985,999.148437);
return 1;
}
return 0;
}
if (strcmp("/exit", cmdtext, true, 6) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,10.0,322.197998,302.497985,999.148437))
{
SetPlayerPos(playerid,2866.9751,1818.5575,11.0125);
return 1;
}
}
return 0;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == infopickup)
{
GameTextForPlayer(playerid,"~g~ Sheriff's Department",3000,1);
}
return 1;
}
stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx - x);
tempposy = (oldposy - y);
tempposz = (oldposz - z);
if(((tempposx < radi)&& (tempposx > - radi))&& ((tempposy < radi)&& (tempposy > - radi))&& ((tempposz < radi)&& (tempposz > - radi)))
{
return 1;
}
}
return 0;
}