Problem sa errorom i warninzima

Započeo Scripterijum, Avgust 30, 2018, 22:56:29 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): errori i warninzi
[code]
C:\Users\Veljko\Desktop\Balkan Republic RolePlay\pawno\include\YSI\..\YSI_Visual\y_commands/impl.inc(180) : error 025: function heading differs from prototype
C:\Users\Veljko\Desktop\New Experience RolePlay\gamemodes\nerp.pwn(1849) : error 025: function heading differs from prototype
C:\Users\Veljko\Desktop\New Experience RolePlay\gamemodes\nerp.pwn(2127) : warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level
C:\Users\Veljko\Desktop\New Experience RolePlay\gamemodes\nerp.pwn(2237) : warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase

Dio skripte: [ pawn ]
180:   pBankovniRacun,
1849: public OnPlayerCommandPerformed(playerid,cmdtext[],success)
2127: foreach(Player, i)
2237: foreach(Player, i)
[ /pawn ]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ code ][ /code ]
Slika/video ingame problema(obavezno ako je ingame problem): link slike
Poslednja Izmena: Septembar 02, 2018, 21:03:42 POSLE PODNE od Bašovski

1849: public OnPlayerCommandPerformed(playerid,cmdtext[],success)

Umjesto toga koristi ovo:

public e_COMMAND_ERRORS:OnPlayerCommandReceived(playerid, cmdtext[], e_COMMAND_ERRORS:success)


2127: foreach(Player, i)
2237: foreach(Player, i)


Te obe linije zamjeni sa ovim:

foreach( new i : Player)

sada dobijam
C:\Users\Veljko\Desktop\New Experience RolePlay\gamemodes\nerp.pwn(1861) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.

linija je return 1; ali mislim da je mozda do ove iznad
new string[ 128 ]; format( string,sizeof( string ),"Igrac %s | Komanda: %s",GetName( playerid ),cmdtext ); LogKomandi( string );

Ne preporucujem ti YCMD 4.0.2, bolje predji na Pawn.CMD (ovo sto je Paul rekao), imao sam dosta iskustva sa tim i veruj mi Pawn.CMD je olaksanje pravo :D
- Mesecni boost pusten ! -
193.104.68.23:27017

Daj nam Funkciju LogKomandi..Djeluje mi sve u redu


@Bespomocni Skripter  sve ovisi kako i Å¡to koristi.

nisam se bavio skriptanjem zadnjih nekoliko meseci i zaboravio sam gomilu stavri pa na sta mislis?

LogKomandi pošalji, može biti stock LogKomandi ili samo LogKomandi, parametar je string u tvom redu:
LogKomandi( string );


Može biti greška u parametru i zato ti izbacuje warning.

stock LogKomandi( string[ ] )
{
	new entry[ 128 ];
	format( entry, sizeof( entry ), "%s\r\n",string );
	new File:hFile;
	hFile = fopen( "Konfiguracija/LogKomandi.log", io_append );
	fwrite( hFile, entry );
	fclose( hFile );
}

Daj ceo OnPlayerCommandReceived, moze biti do cmdtext al prekopiraj ceo junache <3
EDIT: Ovako nije ni do cmdtext jer ne znaci mi nista ovo sto si nam dao :)
EDIT 2: daj getname?
Poslednja Izmena: Avgust 31, 2018, 23:09:04 POSLE PODNE od Bespomocni Skripter
- Mesecni boost pusten ! -
193.104.68.23:27017

public e_COMMAND_ERRORS:OnPlayerCommandReceived(playerid, cmdtext[], e_COMMAND_ERRORS:success)
{
    if( !success ) //return SCM( playerid,-1,""col_larp"(NE:RP) "col_crvena"Upisali ste komandu koja ne postoji, upisite /help za listu komandi." );
    {
		PlayerPlaySound( playerid, 1055,0.0,0.0,0.0 );
		TDHFP( playerid, PogresnaCMD[ 0 ] );
        TDHFP( playerid, PogresnaCMD[ 1 ] );
		TDSFP( playerid, PogresnaCMD[ 0 ] );
        TDSFP( playerid, PogresnaCMD[ 1 ] );
        SetTimerEx( "MicanjeCMD",4000, false, "i", playerid );
	}
	new string[ 128 ]; format( string,sizeof( string ),"Igrac %s | Komanda: %s",GetName( playerid ),cmdtext ); LogKomandi( string );
	return 1;
}

stock GetName( id )
{
	new ime[ MAX_PLAYER_NAME ];
	GetPlayerName( id, ime, sizeof ime );
	return ime;
}

public e_COMMAND_ERRORS:OnPlayerCommandReceived(playerid, cmdtext[], e_COMMAND_ERRORS:success)
{
    if( !success ) //return SCM( playerid,-1,""col_larp"(NE:RP) "col_crvena"Upisali ste komandu koja ne postoji, upisite /help za listu komandi." );
    {
		PlayerPlaySound( playerid, 1055,0.0,0.0,0.0 );
		TDHFP( playerid, PogresnaCMD[ 0 ] );
        TDHFP( playerid, PogresnaCMD[ 1 ] );
		TDSFP( playerid, PogresnaCMD[ 0 ] );
        TDSFP( playerid, PogresnaCMD[ 1 ] );
        SetTimerEx( "MicanjeCMD",4000, false, "i", playerid );
	}
	new string[ 128 ]; format( string,sizeof( string ),"Igrac %s | Komanda: %s",GetName( playerid ),cmdtext ); LogKomandi( string );
	return COMMAND_OK;
}