Problem
#1

Код:
C:\Users\***\Desktop\LA-GW\gamemodes\MWB2.pwn(975) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Код:
    ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Private Class\nSniper Class\nEngineer Class\nMedic Class\nPilot Class\nSpy Class", "Choose","");
Can anybody help me?
Reply
#2

Is there any return above it? If so, remove it and add it after ShowPlayerDialog.

Otherwise show 2 lines before/below.
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Is there any return above it? If so, remove it and add it after ShowPlayerDialog.

Otherwise show 2 lines before/below.
Код:
 //Fuel System
    td_fuel[playerid] = TextDrawCreate(45,324,"Fuel: 100"); //create the textdraw at position
    TextDrawBackgroundColor(td_fuel[playerid],COLOR_GREEN); //setting an nice backgroundcolor
    TextDrawFont(td_fuel[playerid],3); //font type of textdraw
    TextDrawLetterSize(td_fuel[playerid],0.699999,1.700000); //size...
    TextDrawColor(td_fuel[playerid],0x000000ff); //color
    TextDrawSetShadow(td_fuel[playerid],3); //dropping the shadow
    return 1;
	//Class System
    ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Private Class\nSniper Class\nEngineer Class\nMedic Class\nPilot Class\nSpy Class", "Choose","");
    if(gPlayerClass[playerid] == PRIVATE)//This is for the First soldier class.
    {
        TogglePlayerControllable(playerid, 1);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 31, 200);//m4
        GivePlayerWeapon(playerid, 25, 100);//mp5
        GivePlayerWeapon(playerid, 24, 70);//deagle
    }
Sorry for late reply.
Reply
#4

At the first look, I can see the problem, the problem is why is there a return 1;? but there's no }(brackets), showing us the full callback code, would really help fixing you the problem, your code would look like this.
pawn Код:
//Fuel System
    td_fuel[playerid] = TextDrawCreate(45,324,"Fuel: 100"); //create the textdraw at position
    TextDrawBackgroundColor(td_fuel[playerid],COLOR_GREEN); //setting an nice backgroundcolor
    TextDrawFont(td_fuel[playerid],3); //font type of textdraw
    TextDrawLetterSize(td_fuel[playerid],0.699999,1.700000); //size...
    TextDrawColor(td_fuel[playerid],0x000000ff); //color
    TextDrawSetShadow(td_fuel[playerid],3); //dropping the shadow
    // commented return 1;
    //Class System
    ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Private Class\nSniper Class\nEngineer Class\nMedic Class\nPilot Class\nSpy Class", "Choose","");

    if(gPlayerClass[playerid] == PRIVATE)//This is for the First soldier class.
    {
        TogglePlayerControllable(playerid, 1);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 31, 200);//m4
        GivePlayerWeapon(playerid, 25, 100);//mp5
        GivePlayerWeapon(playerid, 24, 70);//deagle
    }
Reply
#5

Quote:
Originally Posted by pds2k12
Посмотреть сообщение
At the first look, I can see the problem, the problem is why is there a return 1;? but there's no }(brackets), showing us the full callback code, would really help fixing you the problem, your code would look like this.
pawn Код:
//Fuel System
    td_fuel[playerid] = TextDrawCreate(45,324,"Fuel: 100"); //create the textdraw at position
    TextDrawBackgroundColor(td_fuel[playerid],COLOR_GREEN); //setting an nice backgroundcolor
    TextDrawFont(td_fuel[playerid],3); //font type of textdraw
    TextDrawLetterSize(td_fuel[playerid],0.699999,1.700000); //size...
    TextDrawColor(td_fuel[playerid],0x000000ff); //color
    TextDrawSetShadow(td_fuel[playerid],3); //dropping the shadow
    // commented return 1;
    //Class System
    ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Private Class\nSniper Class\nEngineer Class\nMedic Class\nPilot Class\nSpy Class", "Choose","");

    if(gPlayerClass[playerid] == PRIVATE)//This is for the First soldier class.
    {
        TogglePlayerControllable(playerid, 1);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 31, 200);//m4
        GivePlayerWeapon(playerid, 25, 100);//mp5
        GivePlayerWeapon(playerid, 24, 70);//deagle
    }
Now this:
Код:
[18:27:20] Script[gamemodes/MWB2.amx]: Run time error 19: "File or function is not found"
But when I compile I get no errors!
Reply
#6

Use this plugin to know why the error occurred

Plugin Link: https://sampforum.blast.hk/showthread.php?tid=249226
Reply
#7

Quote:
Originally Posted by pds2k12
Посмотреть сообщение
Use this plugin to know why the error occurred

Plugin Link: https://sampforum.blast.hk/showthread.php?tid=249226
Код:
[18:34:48]    Error: Function not registered: 'Streamer_CallbackHook'
[18:34:48] Script[gamemodes/MWB2.amx]: Run time error 19: "File or function is not found"
??
Reply
#8

Load streamer plugin.
Reply
#9

Quote:
Originally Posted by boomerboom
Посмотреть сообщение
Код:
[18:34:48]    Error: Function not registered: 'Streamer_CallbackHook'
[18:34:48] Script[gamemodes/MWB2.amx]: Run time error 19: "File or function is not found"
??
Download the latest streamer plugin and re-compile the script with the new plugin and include
Reply
#10

Quote:
Originally Posted by pds2k12
Посмотреть сообщение
Download the latest streamer plugin and re-compile the script with the new plugin and include
Thank you +REP!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)