HELP fixing these warnings REP ++
#1

Okay i got these warnings

pawn Код:
C:\Users\Bichan\Desktop\UKTDM\gamemodes\UKTDM.pwn(329) : warning 225: unreachable code
C:\Users\Bichan\Desktop\UKTDM\gamemodes\UKTDM.pwn(361) : warning 225: unreachable code
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.
pawn Код:
public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid,-1,"Welcome to United Kingdom TDM! Dont forget to check /updates ! ");
    new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "** %s has joined United Kingdom TDM", name);
    SendClientMessageToAll(-1, string);
   
{
    new file[64],PlayerName[25];//Creating a variable where we can store the file path, and the variable to store the player's name.
    GetPlayerName(playerid,PlayerName,sizeof PlayerName);//Storing the players name in the PlayerName variable.
    format(file,sizeof file,"Admin/%s.ini",PlayerName);//Storing the file path with the players name.
    if(!fexist(file))//Checking if the file exists
    {//Here goes the stuff you want to do if the user is not registered.
        SendClientMessage(playerid,-4,"You are not registered! Please use /register <password>");
    }
    else
    {//Here goes the stuff you want to do if the user is registered.
        SendClientMessage(playerid,-4,"You are registered! Use /login <password>");
    }
    return 1;
}

Web = TextDrawCreate(495.000000, 10.000000, "uk-gaming-samp.co.uk/tdm"); // LINE 329
TextDrawBackgroundColor(Web, 255);
TextDrawFont(Web, 1);
TextDrawLetterSize(Web, 0.330000, 1.200000);
TextDrawColor(Web, 10040319);
TextDrawSetOutline(Web, 0);
TextDrawSetProportional(Web, 1);
TextDrawSetShadow(Web, 1);

UKTDM = TextDrawCreate(2.000000, 437.000000, "UK:TDM BETA V2.0 by Max");
TextDrawBackgroundColor(UKTDM, 255);
TextDrawFont(UKTDM, 2);
TextDrawLetterSize(UKTDM, 0.330000, 1.000000);
TextDrawColor(UKTDM, 10040319);
TextDrawSetOutline(UKTDM, 0);
TextDrawSetProportional(UKTDM, 1);
TextDrawSetShadow(UKTDM, 1);

TextDrawShowForPlayer(playerid, Web);
TextDrawShowForPlayer(playerid, UKTDM);
return 1;
}
And

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
{
    PInfo[playerid][Logged] = 0;//Setting the logged in variable to 0.
    return 1;
}

    format(string, sizeof(string), "** %s has left United Kingdom TDM", name);  //LINE 361
    SendClientMessageToAll(-1, string);
    return 1;
}
Reply
#2

Remove the returns and add them to the end of the publics instead. Unless you need to stop the code from going further.
Reply
#3

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    PInfo[playerid][Logged] = 0;//Setting the logged in variable to 0.
   
    new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "** %s has left United Kingdom TDM", name);  //LINE 361
    SendClientMessageToAll(-1, string);
    return 1;
}
pawn Код:
public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid,-1,"Welcome to United Kingdom TDM! Dont forget to check /updates ! ");
    new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "** %s has joined United Kingdom TDM", name);
    SendClientMessageToAll(-1, string);

    new file[64],PlayerName[25];//Creating a variable where we can store the file path, and the variable to store the player's name.
    GetPlayerName(playerid,PlayerName,sizeof PlayerName);//Storing the players name in the PlayerName variable.
    format(file,sizeof file,"Admin/%s.ini",PlayerName);//Storing the file path with the players name.
    if(!fexist(file))//Checking if the file exists
    {//Here goes the stuff you want to do if the user is not registered.
        SendClientMessage(playerid,-4,"You are not registered! Please use /register <password>");
    }
    else
    {//Here goes the stuff you want to do if the user is registered.
        SendClientMessage(playerid,-4,"You are registered! Use /login <password>");
    }
    return 1;
}

//And for these put them under OnGameModeInIt
Web = TextDrawCreate(495.000000, 10.000000, "uk-gaming-samp.co.uk/tdm"); // LINE 329
TextDrawBackgroundColor(Web, 255);
TextDrawFont(Web, 1);
TextDrawLetterSize(Web, 0.330000, 1.200000);
TextDrawColor(Web, 10040319);
TextDrawSetOutline(Web, 0);
TextDrawSetProportional(Web, 1);
TextDrawSetShadow(Web, 1);

UKTDM = TextDrawCreate(2.000000, 437.000000, "UK:TDM BETA V2.0 by Max");
TextDrawBackgroundColor(UKTDM, 255);
TextDrawFont(UKTDM, 2);
TextDrawLetterSize(UKTDM, 0.330000, 1.000000);
TextDrawColor(UKTDM, 10040319);
TextDrawSetOutline(UKTDM, 0);
TextDrawSetProportional(UKTDM, 1);
TextDrawSetShadow(UKTDM, 1);

TextDrawShowForPlayer(playerid, Web);
TextDrawShowForPlayer(playerid, UKTDM);
Reply
#4

Quote:
Originally Posted by Guitar
Посмотреть сообщение
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    PInfo[playerid][Logged] = 0;//Setting the logged in variable to 0.
   
    new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "** %s has left United Kingdom TDM", name);  //LINE 361
    SendClientMessageToAll(-1, string);
    return 1;
}
pawn Код:
public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid,-1,"Welcome to United Kingdom TDM! Dont forget to check /updates ! ");
    new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "** %s has joined United Kingdom TDM", name);
    SendClientMessageToAll(-1, string);

    new file[64],PlayerName[25];//Creating a variable where we can store the file path, and the variable to store the player's name.
    GetPlayerName(playerid,PlayerName,sizeof PlayerName);//Storing the players name in the PlayerName variable.
    format(file,sizeof file,"Admin/%s.ini",PlayerName);//Storing the file path with the players name.
    if(!fexist(file))//Checking if the file exists
    {//Here goes the stuff you want to do if the user is not registered.
        SendClientMessage(playerid,-4,"You are not registered! Please use /register <password>");
    }
    else
    {//Here goes the stuff you want to do if the user is registered.
        SendClientMessage(playerid,-4,"You are registered! Use /login <password>");
    }
    return 1;
}

//And for these put them under OnGameModeInIt
Web = TextDrawCreate(495.000000, 10.000000, "uk-gaming-samp.co.uk/tdm"); // LINE 329
TextDrawBackgroundColor(Web, 255);
TextDrawFont(Web, 1);
TextDrawLetterSize(Web, 0.330000, 1.200000);
TextDrawColor(Web, 10040319);
TextDrawSetOutline(Web, 0);
TextDrawSetProportional(Web, 1);
TextDrawSetShadow(Web, 1);

UKTDM = TextDrawCreate(2.000000, 437.000000, "UK:TDM BETA V2.0 by Max");
TextDrawBackgroundColor(UKTDM, 255);
TextDrawFont(UKTDM, 2);
TextDrawLetterSize(UKTDM, 0.330000, 1.000000);
TextDrawColor(UKTDM, 10040319);
TextDrawSetOutline(UKTDM, 0);
TextDrawSetProportional(UKTDM, 1);
TextDrawSetShadow(UKTDM, 1);

TextDrawShowForPlayer(playerid, Web);
TextDrawShowForPlayer(playerid, UKTDM);
C:\Users\Bichan\Desktop\UKTDM\gamemodes\UKTDM.pwn( 260) : error 010: invalid function or declaration
C:\Users\Bichan\Desktop\UKTDM\gamemodes\UKTDM.pwn( 269) : error 010: invalid function or declaration
C:\Users\Bichan\Desktop\UKTDM\gamemodes\UKTDM.pwn( 27 : error 021: symbol already defined: "TextDrawShowForPlayer"
C:\Users\Bichan\Desktop\UKTDM\gamemodes\UKTDM.pwn( 1097) : warning 203: symbol is never used: "UKTDM"
C:\Users\Bichan\Desktop\UKTDM\gamemodes\UKTDM.pwn( 1097) : warning 203: symbol is never used: "Web"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.


1097 is the last line of the script

and this is the last part of

Ongamemodeinit

pawn Код:
GZ_ZONE1 = GangZoneCreate(-319.3359375,2654.296875,-128.90625,2815.4296875);

GZ_ZONE2 = GangZoneCreate(-2.9296875,1731.4453125,386.71875,2056.640625);

GZ_ZONE3 = GangZoneCreate(-304.6875,1031.25,14.6484375,1221.6796875);

GZ_ZONE4 = GangZoneCreate(102.5390625,2408.203125,465.8203125,2622.0703125);

GZ_ZONE5 = GangZoneCreate(-468.75,2185.546875,-316.40625,2293.9453125);
UsePlayerPedAnims();
DisableInteriorEnterExits();

   
return 1;
}

//And for these put them under OnGameModeInIt
Web = TextDrawCreate(495.000000, 10.000000, "uk-gaming-samp.co.uk/tdm"); // LINE 329
TextDrawBackgroundColor(Web, 255);
TextDrawFont(Web, 1);
TextDrawLetterSize(Web, 0.330000, 1.200000);
TextDrawColor(Web, 10040319);
TextDrawSetOutline(Web, 0);
TextDrawSetProportional(Web, 1);
TextDrawSetShadow(Web, 1);

UKTDM = TextDrawCreate(2.000000, 437.000000, "UK:TDM BETA V2.0 by Max");
TextDrawBackgroundColor(UKTDM, 255);
TextDrawFont(UKTDM, 2);
TextDrawLetterSize(UKTDM, 0.330000, 1.000000);
TextDrawColor(UKTDM, 10040319);
TextDrawSetOutline(UKTDM, 0);
TextDrawSetProportional(UKTDM, 1);
TextDrawSetShadow(UKTDM, 1);

TextDrawShowForPlayer(playerid, Web);
TextDrawShowForPlayer(playerid, UKTDM);

public OnGameModeExit()
{
    return 1;
}
Reply
#5

Fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)