Jump to content
  • 0

Problema /setlevel


SkyLeAs

Question

Problema intalnita (descriere):Salut am facut si eu comanda /setlevel si imi da niste erori si nush ce are..
Ero(area / rile) / warning-(ul / urile):

D:stycMCM (F)ServersRomania Sunt Zone v1.0 www.necro-zone.comgamemodesRSZ.pwn(193) : warning 204: symbol is assigned a value that is never used: "pLevel"
D:stycMCM (F)ServersRomania Sunt Zone v1.0 www.necro-zone.comgamemodesRSZ.pwn(212) : error 017: undefined symbol "gsString"
D:stycMCM (F)ServersRomania Sunt Zone v1.0 www.necro-zone.comgamemodesRSZ.pwn(212) : warning 215: expression has no effect
D:stycMCM (F)ServersRomania Sunt Zone v1.0 www.necro-zone.comgamemodesRSZ.pwn(212) : error 001: expected token: ";", but found "]"
D:stycMCM (F)ServersRomania Sunt Zone v1.0 www.necro-zone.comgamemodesRSZ.pwn(212) : error 029: invalid expression, assumed zero
D:stycMCM (F)ServersRomania Sunt Zone v1.0 www.necro-zone.comgamemodesRSZ.pwn(212) : 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.

Liniile de cod / sursa / script-ul:

CMD:setlevel( playerid, params[ ] )
{
	gsString[ 0 ] = EOS;
    if ( !IsPlayerAdmin( playerid ) )
		return SendError( playerid, "You need to be logged as RCON before use this command!" );
	new
		Player,
		aLevel
	;
	if ( sscanf( params, "ui", Player, aLevel ) )
		return SendClientMessage( playerid, COLOR_ULTRARED, "USAGE: {33CCFF}/setlevel [PlayerID] [Level]" );
	if ( !IsPlayerConnected( Player ) && Player == INVALID_PLAYER_ID )
		return SendError( playerid, "Player not connected!" );
	if ( PlayerInfo[ Player ][ LoggedIn ] == 0 )
		return SendError( playerid, "Player must be registered and logged in!" );
	if ( aLevel > 999999999 && !IsPlayerAdmin( playerid ) )
		return SendError( playerid, "Incorrect Level" );
	if ( aLevel == RSZ_DATA[ playerid ][ RSZLevel ] )
		return SendError( playerid, "Player is already have this level" );
    if ( aLevel > 0 )
		format( gsString, sizeof( gsString ), "Administrator %s has set you to administrator status [Level: %d]", PlayerName( playerid ), aLevel );
    else
		format( gsString, sizeof( gsString ), "Administrator %s has set you to player status [Level: %d]", PlayerName( playerid ), aLevel );
	SendClientMessage( Player, COLOR_ABLUE, gsString );
    if ( aLevel > RSZ_DATA[ playerid ][ RSZLevel ] )
		Announce( Player, "~g~Promoted!", 2000, 3 );
    else
		Announce( Player,"~r~Demoted", 2000, 3 );
    FormatMSG( playerid, COLOR_ABLUE, "You have made %s Level %d on %s", PlayerName( Player ), aLevel, zDate( ) );
    FormatLog( "Admin_Log", "[RCON] %s has made %s Level %d", PlayerName( playerid ), PlayerName( Player ), aLevel );
    RSZ_DATA[ playerid ][ RSZLevel ] = aLevel;
    PlayerPlaySound( Player, 1057, 0.0, 0.0, 0.0 );
    return ( 1 );
}

RSZ_DATA

PublicEx OnPlayerLogin( playerid )
{
	RSZ_DATA[ playerid ][ ID ]       	 = 		cache_get_field_content_int( 0, "ID", RSZ_Handle ) ;
	RSZ_DATA[ playerid ][ RSZLevel ] 	 = 		cache_get_field_content_int( 0, "RSZLevel", RSZ_Handle ) ;

	SetTimerEx( "SpawnPlayerEx", 500, 0, "d", playerid ) ;

	RSZ_Logged[ playerid ] = true;
	return ( 1 ) ;
}
enum PlayerData
{
	ID ,
	RSZLevel,
}

Imagini / Video (optional):!
Ati incercat sa rezolvati singur?:Da am incercat si nmk.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
CMD:setlevel( playerid, params[ ] )
{
	gsString[ 0 ] = EOS;

Aici ai papat un new

 

Asa ar trebui sa fie

CMD:setlevel( playerid, params[ ] )
{
	new gsString[ 0 ] = EOS; - WTF is here?!?

Total Gresit!

CMD:setlevel( playerid, params[] )
{
    new gsString[ 2049 ];
    gsString[ 0 ] = EOS;
Edited by (SE)KnowN

242086.png

Link to comment
Share on other sites

  • 0

1.Nu ai definit gsString . Adauga la inceputul comenzii new gsString[246];

2.Ai mancat o ; . (uita-te la linia 212)

3.Simbolul pLevel este o valoare ce nu este folosita .

Pe scurt sterge "pLevel" din GM,  si dauga variabila locala

new gsString[ 2049 ];

242086.png

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.