SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 22/04/2009, 09:24 PM   #1
Bearfist
Big Clucker
 
Join Date: Apr 2009
Location: Germany
Posts: 172
Reputation: 0
Default Don't want to compile =(

Code:
Here is the Speedo-->>>

[cod]
#define MPS 			0
#define KMPH 			1
#define MPH 			2
#define KNOTS 			3

#define SPEED			KMPH

new Float:ppos[MAX_PLAYERS][3];

Gamemodeinit-->
SetTimer("Speed",1000,true);


public Speed(){
  for(new i=0;i<MAX_PLAYERS;i++){
		if(IsPlayerConnected(i)){
			new Float:x,Float:y,Float:z;
			GetPlayerPos(i,x,y,z);
			new Float:dis = floatsqroot(floatpower(floatabs(floatsub(ppos[i][0],x)),2)+ floatpower(floatabs(ppos[i][1],y)),2)+floatpower(floatabs(floatsub(ppos[i][2],z)),2));
			new tmpstr[256];
			#if SPEED == MPS
			format(tmpstr,sizeof(tmpstr),"~n~~n~~n~~n~					%d~r~MPS",floatround(dis));
			#endif
			#if SPEED == KMPH
			format(tmpstr,sizeof(tmpstr),"~n~~n~~n~~n~					%d  ~r~KMPH",floatround(((dis/1000.0)*60.0)*60.0);
			#endif
			#if SPEED == MPH
			format(tmpstr,sizeof(tmpstr),"~n~~n~~n~~n~					%d ~r~MPH",floatround(((dis/1000.0)*60.0)*60.0)*(5.0/8.0));
			#endif
			#if SPEED == KNOTS
			format(tmpstr,sizeof(tmpstr),"~n~~n~~n~~n~					%d ~r~KNOTS",floatround((((dis/1000.0)*60.0)*60.0)/1.85));
			#endif
            if(IsPlayerInAnyVehicle(i)) GameTextForPlayer(i,tmpstr,2000,4);
            ppos[i][0] = x;
            ppos[i][1] = y;
            ppos[i][2] = z;
		}
	}
}


But I got these errors:
C:\Dokumente und Einstellungen\Besitzer\Desktop\gangdm.pwn(2049) : error 001: expected token: ";", but found ")"
C:\Dokumente und Einstellungen\Besitzer\Desktop\gangdm.pwn(2049) : error 029: invalid expression, assumed zero
C:\Dokumente und Einstellungen\Besitzer\Desktop\gangdm.pwn(2049) : warning 215: expression has no effect
C:\Dokumente und Einstellungen\Besitzer\Desktop\gangdm.pwn(2055) : error 001: expected token: ",", but found ";"

On this line:
Code:
new Float:dis = floatsqroot(floatpower(floatabs(floatsub(ppos[i][0],x)),2)+ floatpower(floatabs(ppos[i][1],y)),2)+floatpower(floatabs(floatsub(ppos[i][2],z)),2));
Bearfist is offline  
Old 22/04/2009, 09:49 PM   #2
sidhu123
Gangsta
 
Join Date: Feb 2008
Posts: 661
Reputation: 0
Default Re: Don't want to compile =(

C:\Dokumente und Einstellungen\Besitzer\Desktop\gangdm.pwn(2049) : error 001: expected token: ";", but found ")"

I'm guessing you forgot a ; on line 2049. If not line 2049, check some code before or after it...
sidhu123 is offline  
Old 22/04/2009, 10:04 PM   #3
Bearfist
Big Clucker
 
Join Date: Apr 2009
Location: Germany
Posts: 172
Reputation: 0
Default Re: Don't want to compile =(

Yes I searched ...
but found nothing =(

...Help Please
Bearfist is offline  
Old 22/04/2009, 10:18 PM   #4
sidhu123
Gangsta
 
Join Date: Feb 2008
Posts: 661
Reputation: 0
Default Re: Don't want to compile =(

Put it in paste bin please?.. That way its easier to see the lines and stuff

Lol...
sidhu123 is offline  
Old 22/04/2009, 10:39 PM   #5
ICECOLDKILLAK8
High-roller
 
Join Date: Aug 2008
Posts: 1,154
Reputation: 5
Default Re: Don't want to compile =(

Try replacing
pawn Code:
new Float:dis = floatsqroot(floatpower(floatabs(floatsub(ppos[i][0],x)),2)+ floatpower(floatabs(ppos[i][1],y)),2)+floatpower(floatabs(floatsub(ppos[i][2],z)),2));
with
pawn Code:
new Float:dis = floatsqroot(floatpower(floatabs(floatsub(ppos[i][0],x)),2)+ floatpower(floatabs(ppos[i][1],y),2)+floatpower(floatabs(floatsub(ppos[i][2],z)),2));
__________________
IVMP
ICECOLDKILLAK8 is offline  
Old 23/04/2009, 04:55 AM   #6
Bearfist
Big Clucker
 
Join Date: Apr 2009
Location: Germany
Posts: 172
Reputation: 0
Default Re: Don't want to compile =(

line 2049
--> number of arguments does not match definition ....

The Speedo begins by ca. 8700 Km/h o.O

Help please !


MFG Bearfist
Bearfist is offline  
 

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
help with Compile John Rockie Help Archive 1 01/02/2010 03:04 PM
Need help, cant compile Gus_Stone Help Archive 5 04/12/2009 04:10 PM
cant compile.. HELP! SanMarinoRP Help Archive 3 14/09/2009 03:00 AM
Look what happens whenever I try to compile :S Mujib Help Archive 4 02/08/2009 09:19 PM
Compile Error. Can Someone Compile For Me Please? RolePlay360 Help Archive 2 11/03/2009 09:56 PM


All times are GMT. The time now is 03:33 PM.


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