SA-MP Forums Archive
Help [ Error ] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help [ Error ] (/showthread.php?tid=575532)



Help [ Error ] - Slawiii - 27.05.2015

when i compiling i got 2 error
Код:
C:\Users\crввzя\Desktop\New Serv\gamemodes\NES.pwn(4015) : warning 217: loose indentation
C:\Users\crввzя\Desktop\New Serv\gamemodes\NES.pwn(24211) : warning 202: number of arguments does not match definition
C:\Users\crввzя\Desktop\New Serv\gamemodes\NES.pwn(29485) : error 001: expected token: "-identifier-", but found "-string-"
C:\Users\crввzя\Desktop\New Serv\gamemodes\NES.pwn(29486) : error 035: argument type mismatch (argument 4)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Line:
Код:
CMD:cstats( playerid, params[ ] )
{
	new Player;
	if ( sscanf( params, "u", Player ) )
	    return SendClientMessage( playerid, COLOR_ULTRARED, "USAGE: /cstats [PlayerID]" );

	if ( !IsPlayerConnected( Player ) )
	    return SendError( playerid, "Player is not connected !" );

	if ( PlayerInfo[ Player ][ ID ] == 0 )
	    return SendError( playerid, "Player is not in any clan !" );

	new H, M, S; ===> Line : 29485
 	TotalClanTime( Player, H, M, S ); ===> Line : 29486
	format( gsString, 512, "\t\t{FF0000}Player Clan Stats:\n\n\
	                        {00FF00}> Clan: {FFFF00}%s\n\
	                        {00FF00}> Points made: {FFFF00}%d\n\
	                        {00FF00}> Deaths: {FFFF00}%d\n", PlayerInfo[ Player ][ Clan ], PlayerInfo[ Player ][ c_points ], PlayerInfo[ Player ][ c_deaths ] );
	format( gsString, 512, "%s{00FF00}> Joined in clan: {FFFF00}%s\n\
							{00FF00}> Clan Time: {FFFF00}%d:%d:%d\n\n\
							{FFFFFF}Use {FF0000}/cstats [PlayerID] {FFFFFF}to see other player clan stats.", gsString, PlayerInfo[ Player ][ JoinedInClan ], H, M, S );
	ShowPlayerDialog( playerid, DIALOG_EMPTY, DIALOG_STYLE_MSGBOX, "{FFFFFF}Stats", gsString, "Ok", "" );
	return 1;
}



Re: Help [ Error ] - PepsiCola23 - 27.05.2015

If you use #pragma tabsize 0 i think you can solve the first one


Re: Help [ Error ] - !damo!spiderman - 28.05.2015

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
If you use #pragma tabsize 0 i think you can solve the first one
Please do not EVER tell anyone to use #pragma tabsize 0, it is wrong and it is bad and it does not teach anyone how to actually code or solve problems.

Which lines are 29485 and 29486, and post your warning lines too.


Re : Help [ Error ] - Slawiii - 28.05.2015

WArning Line:
Код:
Line 24211:
CMD:megastunt( playerid, params[ ] ) 	return NormalTele( playerid, "Mega Stunt", "megastunt", -2940.7786,2627.5505,192.6997,291.6905, -2940.7786,2627.5505,192.6997,291.6905, 0, 0 ), LoadObjects( playerid );



Re: Help [ Error ] - Dubya - 28.05.2015

change
pawn Код:
new H, M, S; ===> Line : 29485
    TotalClanTime( Player, H, M, S ); ===> Line : 29486
to
pawn Код:
new hh,mm,ss;
TotalClanTime( Player, hh,mm,ss );
I believe there might be a global variable or function colliding with you attempting to declare that variable.


Re : Help [ Error ] - Slawiii - 28.05.2015

Wow thank you Dubya + REP


Pleaz help me for that Warning too
Код:
C:\Users\crввzя\Desktop\New Serv\gamemodes\NES.pwn(24211) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Line:
CMD:megastunt( playerid, params[ ] ) return NormalTele( playerid, "Mega Stunt", "megastunt", -2940.7786,2627.5505,192.6997,291.6905, -2940.7786,2627.5505,192.6997,291.6905, 0, 0 ), LoadObjects( playerid );
[/code]


Re: Help [ Error ] - Dubya - 28.05.2015

Show your functions for NormalTele() and LoadObjects()


Re : Help [ Error ] - Slawiii - 28.05.2015

Код:
stock NormalTele( playerid, TeleName[ ], CMDName[ ], Float: VX, Float: VY, Float: VZ, Float: VA, Float: X, Float: Y, Float: Z, Float: A, interior )
{
	PlayerPlaySound( playerid, 1057, 0.0, 0.0, 10.0 );
	if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
	{
		SetVehiclePos( GetPlayerVehicleID( playerid ), VX, VY, VZ );
		SetVehicleZAngle( GetPlayerVehicleID( playerid ), VA );
		LinkVehicleToInterior( GetPlayerVehicleID( playerid ), interior );
		SetCameraBehindPlayer( playerid );
	}
	else
	{
		SetPlayerPos( playerid, Float:X, Float:Y, Float:Z );
		SetPlayerFacingAngle( playerid, Float:A );
		SetPlayerInterior( playerid, interior );
	}
	PlayerInfo[ playerid ][ ActionID ] = 0;
	TogglePlayerControllable( playerid, 1 );

	gsString[ 0 ] = EOS;
    format( gsString, sizeof( gsString ), "~r~~h~%s ~y~~h~has gone to ~b~~h~%s", PlayerName( playerid ), CMDName );
    ShowOnTextDraw( gsString );
    
	format( gsString, sizeof( gsString ), "~y~Teleported to~n~~r~%s", TeleName );
	Announce( playerid, gsString, 3000, 3 );
	
	SetPlayerVirtualWorld( playerid, 0 );
	SetVehicleVirtualWorld( GetPlayerVehicleID( playerid ), 0 );
	return 1;
}



Re: Help [ Error ] - Konstantinos - 28.05.2015

You got 1 more extra argument: NormalTele( playerid, "Mega Stunt", "megastunt", -2940.7786,2627.5505,192.6997,291.6905, -2940.7786,2627.5505,192.6997,291.6905, 0, 0 )

Remove the text with red color.


Re : Help [ Error ] - Slawiii - 28.05.2015

oh thank you for heleping bro