Some Errors I have trouble fixing :s
#1

FBS.pwn(190) : warning 213: tag mismatch
FBS.pwn(19 : warning 213: tag mismatch
FBS.pwn(22 : error 017: undefined symbol "vec"
FBS.pwn(22 : warning 215: expression has no effect
FBS.pwn(22 : error 001: expected token: ";", but found "]"
FBS.pwn(22 : error 029: invalid expression, assumed zero
FBS.pwn(22 : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Errors on this

PHP код:
enum aname
{
SuperPower
}
new 
Abilitys[MAX_PLAYERS][aname];
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
    {
    if(
PRESSED(newkeys KEY_WALK))
    {
    if(
gettime() - Abilitys[playerid][SuperPower])return GameTextForPlayer(playerid,"~w~ Power Recharging!",1000,5);
    
ApplyAnimation(playerid,"ped","Shove_Partial",3.9,0,1,1,1,1,1);
    
SetPlayerAttachedObject(playerid,0,18683,6);
    
SetPlayerAttachedObject(playerid,1,18728,6);
    
SetPlayerAttachedObject(playerid,2,338,6);
    
Abilitys[playerid][SuperPower] = gettime();
    {
    for( new 
0MAX_PLAYERSi++ )
    if(
GetDistanceBetweenPlayers(playerid,i) < 6.0)
    {
    
GetPlayerFacingAngle(i,vec[3]);    GetPlayerVelocity(i,vec[0],vec[1],vec[2]); SetPlayerVelocity(i,vec[0]+0.3,vec[1]+0.3,vec[2]+0.2);
    
SetPlayerFacingAngle(i,vec[3]);
    }
    }
    }
    public 
Float:GetDistanceBetweenPlayers(p1,p2)
    {
    new 
Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    if(!
IsPlayerConnected(p1) || !IsPlayerConnected(p2)) {
    return -
1.00;
    }
    
GetPlayerPos(p1,x1,y1,z1);
    
GetPlayerPos(p2,x2,y2,z2);
    return 
floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub?(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
    }
    return 
1;
}

Line 228

Код:
GetPlayerFacingAngle(i,vec[3]);	GetPlayerVelocity(i,vec[0],vec[1],vec[2]); SetPlayerVelocity(i,vec[0]+0.3,vec[1]+0.3,vec[2]+0.2);
Reply
#2

Hey man, you should have new Float:vec[4]; somewhere up top. It's not defined yet.
Reply
#3

Bump

Help
Reply
#4

PHP код:
 new vec[4]; 
on top of GetPlayerFacingAngle(i,vec[3]);
Reply
#5

PHP код:
#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
enum aname
{
    
SuperPower
}
new 
Abilitys[MAX_PLAYERS][aname];
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
PRESSED(KEY_WALK))
    {
        if(
gettime() - Abilitys[playerid][SuperPower])return GameTextForPlayer(playerid,"~w~ Power Recharging!",1000,5);
        
ApplyAnimation(playerid,"ped","Shove_Partial",3.9,0,1,1,1,1,1);
        
SetPlayerAttachedObject(playerid,0,18683,6);
        
SetPlayerAttachedObject(playerid,1,18728,6);
        
SetPlayerAttachedObject(playerid,2,338,6);
        
Abilitys[playerid][SuperPower] = gettime();
        for(new 
0MAX_PLAYERSi++)
        {
            if(
GetDistanceBetweenPlayers(playerid,i) < 6.0)
            {
                new 
Float:vec[4];
                
GetPlayerVelocity(i,vec[0],vec[1],vec[2]); GetPlayerFacingAngle(i,vec[3]);
                
SetPlayerVelocity(i,vec[0]+0.3,vec[1]+0.3,vec[2]+0.2);
                
SetPlayerFacingAngle(i,vec[3]);
            }
        }
    }
    return 
1;
}
public 
Float:GetDistanceBetweenPlayers(p1,p2)
{
    new 
Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    if(!
IsPlayerConnected(p1) || !IsPlayerConnected(p2)) return -1.00;
    
GetPlayerPos(p1,x1,y1,z1); GetPlayerPos(p2,x2,y2,z2);
    return 
floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub?(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));

Reply
#6

Quote:
Originally Posted by Juvanii
Посмотреть сообщение
PHP код:
#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
enum aname
{
    
SuperPower
}
new 
Abilitys[MAX_PLAYERS][aname];
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
PRESSED(KEY_WALK))
    {
        if(
gettime() - Abilitys[playerid][SuperPower])return GameTextForPlayer(playerid,"~w~ Power Recharging!",1000,5);
        
ApplyAnimation(playerid,"ped","Shove_Partial",3.9,0,1,1,1,1,1);
        
SetPlayerAttachedObject(playerid,0,18683,6);
        
SetPlayerAttachedObject(playerid,1,18728,6);
        
SetPlayerAttachedObject(playerid,2,338,6);
        
Abilitys[playerid][SuperPower] = gettime();
        for(new 
0MAX_PLAYERSi++)
        {
            if(
GetDistanceBetweenPlayers(playerid,i) < 6.0)
            {
                new 
Float:vec[4];
                
GetPlayerVelocity(i,vec[0],vec[1],vec[2]); GetPlayerFacingAngle(i,vec[3]);
                
SetPlayerVelocity(i,vec[0]+0.3,vec[1]+0.3,vec[2]+0.2);
                
SetPlayerFacingAngle(i,vec[3]);
            }
        }
    }
    return 
1;
}
public 
Float:GetDistanceBetweenPlayers(p1,p2)
{
    new 
Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    if(!
IsPlayerConnected(p1) || !IsPlayerConnected(p2)) return -1.00;
    
GetPlayerPos(p1,x1,y1,z1); GetPlayerPos(p2,x2,y2,z2);
    return 
floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub?(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));

FBS.pwn(23 : warning 208: function with tag result used before definition, forcing reparse
FBS.pwn(190) : warning 213: tag mismatch
FBS.pwn(19 : warning 213: tag mismatch
FBS.pwn(216) : warning 206: redundant test: constant expression is non-zero
FBS.pwn(243) : error 076: syntax error in the expression, or invalid function call
FBS.pwn(243) : error 001: expected token: ",", but found ";"
FBS.pwn(303) : error 025: function heading differs from prototype
FBS.pwn(304) : error 021: symbol already defined: "GetDistanceBetweenPlayers"
FBS.pwn(305) : error 001: expected token: ";", but found ":"
FBS.pwn(305) : error 029: invalid expression, assumed zero
FBS.pwn(305) : error 017: undefined symbol "z2"
FBS.pwn(305) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


8 Errors.
Reply
#7

My mistake..

There was a little mistake in the function..
And i should have defined it before using it anywhere.

Anyway here you go:

PHP код:
#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
enum aname
{
    
SuperPower
}
new 
Abilitys[MAX_PLAYERS][aname];
stock Float:GetDistanceBetweenPlayers(p1p2)
{
    if(!
IsPlayerConnected(p1) || !IsPlayerConnected(p2)) return -1.00;
    new 
Float:x1Float:y1Float:z1Float:x2Float:y2Float:z2;
    
GetPlayerPos(p1x1y1z1); GetPlayerPos(p2x2y2z2);
    return 
floatsqroot(floatpower(floatabs(floatsub(x2x1)), 2) + floatpower(floatabs(floatsub(y2y1)), 2) + floatpower(floatabs(floatsub(z2z1)), 2));
}
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
PRESSED(KEY_WALK))
    {
        if(
gettime() - Abilitys[playerid][SuperPower])return GameTextForPlayer(playerid,"~w~ Power Recharging!",1000,5);
        
ApplyAnimation(playerid,"ped","Shove_Partial",3.9,0,1,1,1,1,1);
        
SetPlayerAttachedObject(playerid,0,18683,6);
        
SetPlayerAttachedObject(playerid,1,18728,6);
        
SetPlayerAttachedObject(playerid,2,338,6);
        
Abilitys[playerid][SuperPower] = gettime();
        for(new 
0MAX_PLAYERSi++)
        {
            if(
GetDistanceBetweenPlayers(playerid,i) < 6.0)
            {
                new 
Float:vec[4];
                
GetPlayerVelocity(i,vec[0],vec[1],vec[2]); GetPlayerFacingAngle(i,vec[3]);
                
SetPlayerVelocity(i,vec[0]+0.3,vec[1]+0.3,vec[2]+0.2);
                
SetPlayerFacingAngle(i,vec[3]);
            }
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)