#include <a_samp>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("Admin Crib");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/enter", true)==0)
{
new i, Float:X, Float:Y, Float:Z; //this is where your coords will get stored
for (i = 0; i < MAX_PLAYERS; i++) //this is a loop
{
GetPlayerPos(i, X, Y, Z); //stores your pos
if(2049.48,2763.07,10.82) //coords for entering house
{
SetPlayerInterior(playerid, 12); //interiorID is the Interior the house is in
SetPlayerPos(playerid, 2049.48, 2763.07, 10.82); // X, Y, Z are the coords where the house is located
}
}
return 1;
}
C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(30) : warning 206: redundant test: constant expression is non-zero C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(39) : error 030: compound statement not closed at the end of file (started at line 24) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
if(2049.48,2763.07,10.82)
if(X == 2049.48 && Y == 2763.07 && Z == 10.82)
Originally Posted by =>Sandra<=
Код:
if(X == 2049.48 && Y == 2763.07 && Z == 10.82) |
C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(39) : error 030: compound statement not closed at the end of file (started at line 24)
Originally Posted by =>Sandra<=
But because the coords are very precise, it's almost impossible to be exactly at those coords. Better search for a PlayerToPoint-function and use that.
|
Originally Posted by Mr. M
Quote:
Still got this one; Код:
C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(39) : error 030: compound statement not closed at the end of file (started at line 24) Quote:
|
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;
}
if(PlayerToPoint(3, playerid, x, y, z))
public OnPlayerCommandText(playerid, cmdtext[])
{
stock PlayerToPoint(Float:3, playerid, Float:2049.48, Float:2763.07, Float:10.82)
{
if(IsPlayerConnected(playerid))
{
new Float:2049.48, Float:2763.07, Float:10.82;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, 2049.48, 2763.07, 10.82);
tempposx = (2049.48);
tempposy = (2763.07);
tempposz = (10.82);
if (((tempposx < 3) && (tempposx > -3)) && ((tempposy < 3) && (tempposy > -3)) && ((tempposz < 3) && (tempposz > -3)))
{
return 1;
}
}
return 0;
}
C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(24) : error 029: invalid expression, assumed zero C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(24) : error 017: undefined symbol "PlayerToPoint" C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(28) : error 001: expected token: "-identifier-", but found "-rational value-" C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(30) : error 035: argument type mismatch (argument 2) C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(42) : error 030: compound statement not closed at the end of file (started at line 24) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
Originally Posted by ♦۞pкћп§-шŧųĄ۞♦
Its in the wrong place and you are not using it correctly my young Jedi. Here
http://forum.sa-mp.com/index.php?topic=87145.0 |
#include <a_samp>
#define PlayerToPoint
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("Admin Crib Loaded");
return 1;
}
// -----------------------------------------------------------------------------
public OnFilterScriptExit()
{
print("Admin Crib Unloaded");
return 1;
}
// -----------------------------------------------------------------------------
#else
// -----------------------------------------------------------------------------
#endif
// -----------------------------------------------------------------------------
public OnGameModeInit()
{
DisableInteriorEnterExits();
CreatePickup(1239,1,2049.48,2763.07,10.82); // Icon
return 1;
}
// -----------------------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/enter",cmdtext,true,6) == 0)
{
if(PlayerToPoint(3,playerid,2049.48,2763.07,10.82)) // House Entramce
{
SetPlayerInterior(playerid, 12); // Sets Player to Interior 12
SetPlayerPos(playerid, 2324.4199,-1145.5699,1050.7101); // Spawn position inside
return 1;
}
return 1;
}
if (strcmp("/exit",cmdtext,true,5) == 0)
{
if(PlayerToPoint(3,playerid,2049.48,2763.07,10.82)) // House Entrance
{
SetPlayerInterior(playerid, 0); // this is important..interior 0 is outside...
SetPlayerPos(playerid, 2290.0496,2430.2283,10.8203); // this is where player will stand...
return 1;
}
return 1;
}
// -----------------------------------------------------------------------------
stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
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 < 3) && (tempposx > -3)) && ((tempposy < 3) && (tempposy > -3)) && ((tempposz < 3) && (tempposz > -3)))
{
return 1;
}
return 0;
}
C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(43) : warning 206: redundant test: constant expression is non-zero C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(53) : warning 206: redundant test: constant expression is non-zero C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(64) : warning 217: loose indentation C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(64) : error 029: invalid expression, assumed zero C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(64) : error 017: undefined symbol "radi" C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(69) : error 017: undefined symbol "x" C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(70) : error 017: undefined symbol "y" C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(71) : error 017: undefined symbol "z" C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(78) : error 030: compound statement not closed at the end of file (started at line 41) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Errors.
#include <a_samp>
//Leave this line below.
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2])))))return 1
//Leave this here.
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;
}
public OnFilterScriptInit()
{
print("Admin Crib Loaded");
DisableInteriorEnterExits();
CreatePickup(1239, 1, 2049.48, 2763.07, 10.82); // Icon Where you placed your icon is the enter point.
return 1;
}
public OnFilterScriptExit()
{
print("Admin Crib Unloaded");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(enter, 5, cmdtext);//DCMD is very easy to use. Just put your cmdtext here.
dcmd(exit, 4, cmdtext);
return 0;
}
//Then make sure your code is at bottom of script.
dcmd_enter(playerid, params[])
{
#pragma unused params
if(PlayerToPoint(3,playerid, 2049.48,2763.07,10.82)) // House Entramce. Where you set icon.
{
SetPlayerInterior(playerid, 12); // Sets Player to Interior 12
SetPlayerPos(playerid, 2324.4199, -1145.5699, 1050.7101); // Spawn position inside
return 1;
}
return 1;
}
dcmd_exit(playerid, params[])
{
#pragma unused params
if(PlayerToPoint(3 ,playerid, 2324.4199, -1145.5699, 1050.7101)) // House Exit
{
SetPlayerInterior(playerid, 0); // this is important..interior 0 is outside...
SetPlayerPos(playerid, 2049.48, 2763.07, 10.82); // this is where player will stand...
return 1;
}
return 1;
}
//If you want to change the commands back by all means do so. Take note of how the co-ordinates are setup as yours where wrong.