Üdv itt van ez a script de hibás kéne nekem egy kis segítség.
[pawn]if(IsPlayerInRangeOfPoint(playerid,3.0,2123.0464,44.5196,26.4302) )
{
if(IsPlayerInAnyVehicle(playerid))
{
SetPlayerSpeedCap(playerid,0.2);
}
}[/pawn]
És ezek a hibák vannak benne:
C:\\Users\\Ati\\Desktop\\MOJE DOKUMENTY\\GTA San Andreas\\Personal\\Dunra RPG szerver\\gamemodes\\dunrarpg.pwn(54264) : error 017: undefined symbol \"SetPlayerSpeedCap\"
C:\\Users\\Ati\\Desktop\\MOJE DOKUMENTY\\GTA San Andreas\\Personal\\Dunra RPG szerver\\gamemodes\\dunrarpg.pwn(54271) : error 017: undefined symbol \"SetPlayerSpeedCap\"
Elõre is köszönöm.
defináld
undefined symbol \"SetPlayerSpeedCap\"
undefined symbol \"SetPlayerSpeedCap\"
defináld
undefined symbol \"SetPlayerSpeedCap\"
undefined symbol \"SetPlayerSpeedCap\"
Ennyit én is tudok de hogyan kell ez itt a kérdés.
stock SetPlayerSpeedCap(playerid, value)
{
// Funkció
}
A letöltési link valóban rossz a hozzászólásokban szokás ilyenkor keresgélni ezt találtam:
http://forum.sa-mp.com/showpost.php?p=1253404&postcount=27
És ezt:
http://webcache.googleusercontent.com/search?q=cache:v1dyNP6ivIIJ:realcop228.com/sampreleases/notmine/speedcap.inc+http://realcop228.com/sampreleases/&cd=3&hl=hu&ct=clnk&gl=hu
/*
Vehicle speed cap filterscript.
-----------
This makes it possible to limit the maxspeed of vehicles; there are, however, a few things to consider.
* This will not work well on people with high pings.
* This works best with lower server rates.
* Driving at the speed limit will cause the handling to be different; however, if
used for roleplay, driving real-life like shouldn\'t be an issue with this at all!
How do I get started with this?
First off,
Try it on to see if it works. Load the filterscript, go ingame, and log in with /rcon login.
Now, use the testing command /myspeedcap to see if it works. An example of a value that feels like 50 km/h is 0.3.
So, simply:
/myspeedcap 0.3
Put the macros below in your other scripts and do this for example:
SetPlayerSpeedCap( playerid, 0.3 );
Another example that disables speed cap only for the NRG:
public OnPlayerEnterVehicle( playerid, vehicleid, ispassenger )
{
new modelid = GetVehicleModel( vehicleid );
if ( modelid == 522 ) // 522 - NRG-500
SetPlayerSpeedCap( playerid, 0.4 );
else
DisablePlayerSpeedCap( playerid );
}
Put this in other scripts so they can change the speed cap easily.
#define SetPlayerSpeedCap(%0,%1) CallRemoteFunction( \"SetPlayerSpeedCap\", \"if\", %0, %1 )
#define DisablePlayerSpeedCap(%0) CallRemoteFunction( \"DisablePlayerSpeedCap\", \"i\", %0 )
Author: Slice
*/
#include <a_samp>
#include <YSI\\y_hooks>
forward SetPlayerSpeedCap( playerid, Float:value );
forward DisablePlayerSpeedCap( playerid );
new
Float:g_fSpeedCap[ MAX_PLAYERS ] = { 0.0, ... }
;
hook OnPlayerUpdate(playerid)
{
static
s_iVehicle
;
if ( g_fSpeedCap[ playerid ] != 0.0 && GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
{
s_iVehicle = GetPlayerVehicleID( playerid );
if ( s_iVehicle )
{
static
Float:s_fX,
Float:s_fY,
Float:s_fZ,
Float:s_fVX,
Float:s_fVY,
Float:s_fVZ
;
GetVehiclePos( s_iVehicle, s_fX, s_fY, s_fZ );
GetVehicleVelocity( s_iVehicle, s_fVX, s_fVY, s_fVZ );
if ( !IsPlayerInRangeOfPoint( playerid, g_fSpeedCap[ playerid ] + 0.05, s_fX + s_fVX, s_fY + s_fVY, s_fZ + s_fVZ ) )
{
static
Float:s_fLength
;
s_fLength = floatsqroot( ( s_fVX * s_fVX ) + ( s_fVY * s_fVY ) + ( s_fVZ * s_fVZ ) );
s_fVX = ( s_fVX / s_fLength ) * g_fSpeedCap[ playerid ];
s_fVY = ( s_fVY / s_fLength ) * g_fSpeedCap[ playerid ];
s_fVZ = ( s_fVZ / s_fLength ) * g_fSpeedCap[ playerid ];
if ( s_iVehicle )
SetVehicleVelocity( s_iVehicle, s_fVX, s_fVY, s_fVZ );
else
SetPlayerVelocity( playerid, s_fVX, s_fVY, s_fVZ );
}
}
}
return 1;
}
/*public OnPlayerCommandText( playerid, cmdtext[ ] )
{
if ( !IsPlayerAdmin( playerid ) )
return 0;
if ( !strcmp( \"/myspeedcap\", cmdtext, true, 11 ) )
{
new
szMessage[ 24 ]
;
if ( !( cmdtext[ 11 ] && cmdtext[ 12 ] ) )
{
SendClientMessage( playerid, -1, \"USAGE: /myspeedcap [max speed]\" );
SendClientMessage( playerid, -1, \"USAGE: 0 will disable the speed cap.\" );
return 1;
}
g_fSpeedCap[ playerid ] = floatstr( cmdtext[ 12 ] );
format( szMessage, sizeof( szMessage ), \"* Speed cap: %0.4f\", g_fSpeedCap[ playerid ] );
SendClientMessage( playerid, 0xFFFF00FF, szMessage );
return 1;
}
return 0;
}*/
public SetPlayerSpeedCap( playerid, Float:value )
{
if ( 0 <= playerid < sizeof( g_fSpeedCap ) )
g_fSpeedCap[ playerid ] = value;
}
public DisablePlayerSpeedCap( playerid )
{
if ( 0 <= playerid < sizeof( g_fSpeedCap ) )
g_fSpeedCap[ playerid ] = 0.0;
}
A letöltési link valóban rossz a hozzászólásokban szokás ilyenkor keresgélni ezt találtam:
http://forum.sa-mp.com/showpost.php?p=1253404&postcount=27
És ezt:
http://webcache.googleusercontent.com/search?q=cache:v1dyNP6ivIIJ:realcop228.com/sampreleases/notmine/speedcap.inc+http://realcop228.com/sampreleases/&cd=3&hl=hu&ct=clnk&gl=hu
/*
Vehicle speed cap filterscript.
-----------
This makes it possible to limit the maxspeed of vehicles; there are, however, a few things to consider.
* This will not work well on people with high pings.
* This works best with lower server rates.
* Driving at the speed limit will cause the handling to be different; however, if
used for roleplay, driving real-life like shouldn\'t be an issue with this at all!
How do I get started with this?
First off,
Try it on to see if it works. Load the filterscript, go ingame, and log in with /rcon login.
Now, use the testing command /myspeedcap to see if it works. An example of a value that feels like 50 km/h is 0.3.
So, simply:
/myspeedcap 0.3
Put the macros below in your other scripts and do this for example:
SetPlayerSpeedCap( playerid, 0.3 );
Another example that disables speed cap only for the NRG:
public OnPlayerEnterVehicle( playerid, vehicleid, ispassenger )
{
new modelid = GetVehicleModel( vehicleid );
if ( modelid == 522 ) // 522 - NRG-500
SetPlayerSpeedCap( playerid, 0.4 );
else
DisablePlayerSpeedCap( playerid );
}
Put this in other scripts so they can change the speed cap easily.
#define SetPlayerSpeedCap(%0,%1) CallRemoteFunction( \"SetPlayerSpeedCap\", \"if\", %0, %1 )
#define DisablePlayerSpeedCap(%0) CallRemoteFunction( \"DisablePlayerSpeedCap\", \"i\", %0 )
Author: Slice
*/
#include <a_samp>
#include <YSI\\y_hooks>
forward SetPlayerSpeedCap( playerid, Float:value );
forward DisablePlayerSpeedCap( playerid );
new
Float:g_fSpeedCap[ MAX_PLAYERS ] = { 0.0, ... }
;
hook OnPlayerUpdate(playerid)
{
static
s_iVehicle
;
if ( g_fSpeedCap[ playerid ] != 0.0 && GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
{
s_iVehicle = GetPlayerVehicleID( playerid );
if ( s_iVehicle )
{
static
Float:s_fX,
Float:s_fY,
Float:s_fZ,
Float:s_fVX,
Float:s_fVY,
Float:s_fVZ
;
GetVehiclePos( s_iVehicle, s_fX, s_fY, s_fZ );
GetVehicleVelocity( s_iVehicle, s_fVX, s_fVY, s_fVZ );
if ( !IsPlayerInRangeOfPoint( playerid, g_fSpeedCap[ playerid ] + 0.05, s_fX + s_fVX, s_fY + s_fVY, s_fZ + s_fVZ ) )
{
static
Float:s_fLength
;
s_fLength = floatsqroot( ( s_fVX * s_fVX ) + ( s_fVY * s_fVY ) + ( s_fVZ * s_fVZ ) );
s_fVX = ( s_fVX / s_fLength ) * g_fSpeedCap[ playerid ];
s_fVY = ( s_fVY / s_fLength ) * g_fSpeedCap[ playerid ];
s_fVZ = ( s_fVZ / s_fLength ) * g_fSpeedCap[ playerid ];
if ( s_iVehicle )
SetVehicleVelocity( s_iVehicle, s_fVX, s_fVY, s_fVZ );
else
SetPlayerVelocity( playerid, s_fVX, s_fVY, s_fVZ );
}
}
}
return 1;
}
/*public OnPlayerCommandText( playerid, cmdtext[ ] )
{
if ( !IsPlayerAdmin( playerid ) )
return 0;
if ( !strcmp( \"/myspeedcap\", cmdtext, true, 11 ) )
{
new
szMessage[ 24 ]
;
if ( !( cmdtext[ 11 ] && cmdtext[ 12 ] ) )
{
SendClientMessage( playerid, -1, \"USAGE: /myspeedcap [max speed]\" );
SendClientMessage( playerid, -1, \"USAGE: 0 will disable the speed cap.\" );
return 1;
}
g_fSpeedCap[ playerid ] = floatstr( cmdtext[ 12 ] );
format( szMessage, sizeof( szMessage ), \"* Speed cap: %0.4f\", g_fSpeedCap[ playerid ] );
SendClientMessage( playerid, 0xFFFF00FF, szMessage );
return 1;
}
return 0;
}*/
public SetPlayerSpeedCap( playerid, Float:value )
{
if ( 0 <= playerid < sizeof( g_fSpeedCap ) )
g_fSpeedCap[ playerid ] = value;
}
public DisablePlayerSpeedCap( playerid )
{
if ( 0 <= playerid < sizeof( g_fSpeedCap ) )
g_fSpeedCap[ playerid ] = 0.0;
}
Ebben a kódban 10 error van mégpedig a következõk:
C:\\Documents and Settings\\Szabó\\Plocha\\Dunra RPG szerver\\filterscripts\\lassito.pwn(81) : error 010: invalid function or declaration
C:\\Documents and Settings\\Szabó\\Plocha\\Dunra RPG szerver\\filterscripts\\lassito.pwn(83) : error 010: invalid function or declaration
C:\\Documents and Settings\\Szabó\\Plocha\\Dunra RPG szerver\\filterscripts\\lassito.pwn(87) : error 010: invalid function or declaration
C:\\Documents and Settings\\Szabó\\Plocha\\Dunra RPG szerver\\filterscripts\\lassito.pwn(89) : error 010: invalid function or declaration
C:\\Documents and Settings\\Szabó\\Plocha\\Dunra RPG szerver\\filterscripts\\lassito.pwn(95) : error 010: invalid function or declaration
C:\\Documents and Settings\\Szabó\\Plocha\\Dunra RPG szerver\\filterscripts\\lassito.pwn(140) : warning 203: symbol is never used: \"s_fLength\"
C:\\Documents and Settings\\Szabó\\Plocha\\Dunra RPG szerver\\filterscripts\\lassito.pwn(140) : warning 203: symbol is never used: \"s_fVX\"
C:\\Documents and Settings\\Szabó\\Plocha\\Dunra RPG szerver\\filterscripts\\lassito.pwn(140) : warning 203: symbol is never used: \"s_fVY\"
C:\\Documents and Settings\\Szabó\\Plocha\\Dunra RPG szerver\\filterscripts\\lassito.pwn(140) : warning 203: symbol is never used: \"s_fVZ\"
C:\\Documents and Settings\\Szabó\\Plocha\\Dunra RPG szerver\\filterscripts\\lassito.pwn(140) : warning 203: symbol is never used: \"s_fX\"
C:\\Documents and Settings\\Szabó\\Plocha\\Dunra RPG szerver\\filterscripts\\lassito.pwn(140) : warning 203: symbol is never used: \"s_fY\"
C:\\Documents and Settings\\Szabó\\Plocha\\Dunra RPG szerver\\filterscripts\\lassito.pwn(140) : warning 203: symbol is never used: \"s_fZ\"
C:\\Documents and Settings\\Szabó\\Plocha\\Dunra RPG szerver\\filterscripts\\lassito.pwn(140) : warning 203: symbol is never used: \"s_iVehicle\"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
10 Errors.