07.02.2009, 20:38
Ok, i found interior i wanted, Large modern unused Safehouse, but still get errors
Errors:
pawn Код:
#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.