SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 11/05/2013, 07:47 PM   #1
xXitsgodzillaXx
Huge Clucker
 
xXitsgodzillaXx's Avatar
 
Join Date: Sep 2011
Location: The Birth Canal.
Posts: 386
Reputation: 12
Default Undefined symbol...

pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SPRINT && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
            if(IsNitro[playerid] == 1)
            {
                if(GetPlayerSpeed(playerid) <= 3)
                {
                    new vehicleid = GetPlayerVehicleID(playerid);
                    new Float:Xv, Float:Yv, Float:Zv, Float:absV;
                    GetVehicleVelocity(vehicleid, Xv, Yv, Zv);
                    absV = floatsqroot(floatpower(floatabs(Xv),2)+floatpower(floatabs(Yv),2)+floatpower(floatabs(Zv),2));
                    if(absV < 20.0)
                    {
                        new Float:Zangle;
                        GetVehicleZAngle(vehicleid, Zangle);
                        GetVehicleVelocity(vehicleid, Xv, Yv, Zv);
                        Xv = (9.5 * absV * floatsin(Zangle, degrees));
                        Yv = (9.5 * absV * floatcos(Zangle, degrees));
                        SetVehicleAngularVelocity(vehicleid, Yv, Xv, 0);
                    }
                }
                else if(GetPlayerSpeed(playerid) >= 3) return 0;
            }
            else if(IsNitro[playerid] != 1) return 0;
    }
    return 1;
}

Code:
Undefined symbol "GetPlayerSpeed"

Line:16090 "if(GetPlayerSpeed(playerid) <= 3)"

and

Line:16106 "else if(GetPlayerSpeed(playerid) >= 3) return 0;"
I dont understand why it isnt working it was working all day until i tried to implement some mSelection menus in my gamemode.
__________________
DDP United States Invasion TDM is at 89%!
xXitsgodzillaXx is offline   Reply With Quote
Old 11/05/2013, 07:50 PM   #2
radiobizza
Huge Clucker
 
Join Date: Dec 2012
Location: Romania
Posts: 342
Reputation: 14
Default Re: Undefined symbol...

PHP Code:
new GetPlayerSpeed[MAX_PLAYERS]; 
__________________
Quote:
Originally Posted by amitdahari View Post
I'm Scripting and map editing for more then 3years and i MUST SAY
THIS IS AMAZING!
radiobizza is offline   Reply With Quote
Old 11/05/2013, 08:02 PM   #3
xXitsgodzillaXx
Huge Clucker
 
xXitsgodzillaXx's Avatar
 
Join Date: Sep 2011
Location: The Birth Canal.
Posts: 386
Reputation: 12
Default Re: Undefined symbol...

Quote:
Originally Posted by radiobizza View Post
PHP Code:
new GetPlayerSpeed[MAX_PLAYERS]; 
Code:
C:\Documents and Settings\Owner\Desktop\saserver\gamemodes\DDPDRIFT.pwn(16091) : error 012: invalid function call, not a valid address
C:\Documents and Settings\Owner\Desktop\saserver\gamemodes\DDPDRIFT.pwn(16091) : warning 215: expression has no effect
C:\Documents and Settings\Owner\Desktop\saserver\gamemodes\DDPDRIFT.pwn(16091) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Owner\Desktop\saserver\gamemodes\DDPDRIFT.pwn(16091) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\saserver\gamemodes\DDPDRIFT.pwn(16091) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
I never had that at the top of my script never needed it. but this is what i got.
__________________
DDP United States Invasion TDM is at 89%!
xXitsgodzillaXx is offline   Reply With Quote
Old 11/05/2013, 08:08 PM   #4
radiobizza
Huge Clucker
 
Join Date: Dec 2012
Location: Romania
Posts: 342
Reputation: 14
Default Re: Undefined symbol...

Where you put them?
__________________
Quote:
Originally Posted by amitdahari View Post
I'm Scripting and map editing for more then 3years and i MUST SAY
THIS IS AMAZING!
radiobizza is offline   Reply With Quote
Old 11/05/2013, 08:17 PM   #5
xXitsgodzillaXx
Huge Clucker
 
xXitsgodzillaXx's Avatar
 
Join Date: Sep 2011
Location: The Birth Canal.
Posts: 386
Reputation: 12
Default Re: Undefined symbol...

Quote:
Originally Posted by radiobizza View Post
Where you put them?
at the top of my script, i also tried it at the top of the snippet i gave on the first post. still got the same errors
__________________
DDP United States Invasion TDM is at 89%!
xXitsgodzillaXx is offline   Reply With Quote
Old 11/05/2013, 08:20 PM   #6
Rayan_black
Huge Clucker
 
Rayan_black's Avatar
 
Join Date: Jan 2012
Posts: 355
Reputation: 46
Default Re : Undefined symbol...

Show me line number 16071
Rayan_black is offline   Reply With Quote
Old 11/05/2013, 08:21 PM   #7
radiobizza
Huge Clucker
 
Join Date: Dec 2012
Location: Romania
Posts: 342
Reputation: 14
Default Re: Undefined symbol...

He look like that?
PHP Code:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    new 
GetPlayerSpeed[MAX_PLAYERS];  
    if(
newkeys KEY_SPRINT && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
            if(
IsNitro[playerid] == 1)
            {
                if(
GetPlayerSpeed(playerid) <= 3)
                {
                    new 
vehicleid GetPlayerVehicleID(playerid);
                    new 
Float:XvFloat:YvFloat:ZvFloat:absV;
                    
GetVehicleVelocity(vehicleidXvYvZv);
                    
absV floatsqroot(floatpower(floatabs(Xv),2)+floatpower(floatabs(Yv),2)+floatpower(floatabs(Zv),2));
                    if(
absV 20.0)
                    {
                        new 
Float:Zangle;
                        
GetVehicleZAngle(vehicleidZangle);
                        
GetVehicleVelocity(vehicleidXvYvZv);
                        
Xv = (9.5 absV floatsin(Zangledegrees));
                        
Yv = (9.5 absV floatcos(Zangledegrees));
                        
SetVehicleAngularVelocity(vehicleidYvXv0);
                    }
                }
                else if(
GetPlayerSpeed(playerid) >= 3) return 0;
            }
            else if(
IsNitro[playerid] != 1) return 0;
    }
    return 
1;

__________________
Quote:
Originally Posted by amitdahari View Post
I'm Scripting and map editing for more then 3years and i MUST SAY
THIS IS AMAZING!
radiobizza is offline   Reply With Quote
Old 11/05/2013, 08:23 PM   #8
xXitsgodzillaXx
Huge Clucker
 
xXitsgodzillaXx's Avatar
 
Join Date: Sep 2011
Location: The Birth Canal.
Posts: 386
Reputation: 12
Default Re: Undefined symbol...

Quote:
Originally Posted by Rayan_black View Post
Show me line number 16071
I think you mean line 16107 and that is just a }

Quote:
Originally Posted by radiobizza View Post
He look like that?
PHP Code:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    new 
GetPlayerSpeed[MAX_PLAYERS];  
    if(
newkeys KEY_SPRINT && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
            if(
IsNitro[playerid] == 1)
            {
                if(
GetPlayerSpeed(playerid) <= 3)
                {
                    new 
vehicleid GetPlayerVehicleID(playerid);
                    new 
Float:XvFloat:YvFloat:ZvFloat:absV;
                    
GetVehicleVelocity(vehicleidXvYvZv);
                    
absV floatsqroot(floatpower(floatabs(Xv),2)+floatpower(floatabs(Yv),2)+floatpower(floatabs(Zv),2));
                    if(
absV 20.0)
                    {
                        new 
Float:Zangle;
                        
GetVehicleZAngle(vehicleidZangle);
                        
GetVehicleVelocity(vehicleidXvYvZv);
                        
Xv = (9.5 absV floatsin(Zangledegrees));
                        
Yv = (9.5 absV floatcos(Zangledegrees));
                        
SetVehicleAngularVelocity(vehicleidYvXv0);
                    }
                }
                else if(
GetPlayerSpeed(playerid) >= 3) return 0;
            }
            else if(
IsNitro[playerid] != 1) return 0;
    }
    return 
1;

Yep did that and got the same exact errors.
__________________
DDP United States Invasion TDM is at 89%!
xXitsgodzillaXx is offline   Reply With Quote
Old 11/05/2013, 08:45 PM   #9
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,316
Reputation: 905
Default Re: Undefined symbol...

Quote:
Originally Posted by radiobizza View Post
PHP Code:
new GetPlayerSpeed[MAX_PLAYERS]; 
Please don't post if you have no clue whatsoever what the fuck you're on about. Who is that helping?


@OP: You need to define the function - READ THE ERROR.
__________________
>> Click here to see my releases.

Please do not PM me requesting help. Here you have a forum with 11,000+ active users - why are you limiting your help to one person?
MP2 is offline   Reply With Quote
Old 11/05/2013, 09:06 PM   #10
xXitsgodzillaXx
Huge Clucker
 
xXitsgodzillaXx's Avatar
 
Join Date: Sep 2011
Location: The Birth Canal.
Posts: 386
Reputation: 12
Default Re: Undefined symbol...

Quote:
Originally Posted by MP2 View Post
Please don't post if you have no clue whatsoever what the fuck you're on about. Who is that helping?


@OP: You need to define the function - READ THE ERROR.
it never had to be defined before, but how would I do that?
__________________
DDP United States Invasion TDM is at 89%!
xXitsgodzillaXx is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
undefined symbol and symbol is assigned a value that is never used Proph3t Scripting Help 2 11/04/2013 02:54 PM
Undefined Symbol Serizawa Scripting Help 3 04/11/2012 09:24 AM
Undefined Symbol Laure Scripting Help 3 03/10/2012 12:18 PM
Undefined Symbol jtemple042996 Scripting Help 5 28/02/2012 11:48 PM
[HELP]Undefined symbol errors when symbol is defined PCheriyan007 Help Archive 9 07/07/2011 01:09 AM


All times are GMT. The time now is 03:45 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.