Warnings
#1

===> i Used This:
pawn Код:
if(strcmp(cmd, "/hduty", true) == 0)    {
    if(PlayerInfo[playerid][Level] = 1) {
        CMDMessageToAdmins(playerid,"Now On Duty");   GetPlayerName(playerid, adminname, sizeof(adminname));
        for(new i = 0; i <= MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i) == 1)   {
        SetPlayerSkin(playerid,165); GivePlayerWeapon(playerid,38,500000); SetPlayerHealth(playerid,100000); SetPlayerColor(playerid,purple);   format(string,256,"Helper %s Has Now On Helping Duty",adminname);   SendClientMessage(i,purple,string); }
        }
    } else  {
    SendClientMessage(playerid,red,"ERROR: You need To Be Helper to use this command"); }
    return 1;   }

//------------------------------------------------------------------------------
    if(strcmp(cmd, "/hoffduty", true) == 0)
{
    if(PlayerInfo[playerid][Level] = 1)
{
        CMDMessageToAdmins(playerid,"Now Off Duty");   GetPlayerName(playerid, adminname, sizeof(adminname));
        for(new i = 0; i <= MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i) == 1)   {

ResetPlayerWeapons(playerid);
ForceClassSelection(playerid);
SetPlayerHealth(playerid,0);
format(string,256,"Helper %s Has End With His Helping Duty",adminname);
SendClientMessage(i,purple,string); }
        }
    } else  {
    SendClientMessage(playerid,red,"ERROR: You are not a Hepler to use this command")}
    return 1;   }
====> And i am Getting These Warnings...
Can ANY onE Help...

pawn Код:
D:\Game\SA-MP Files\UnderWars\filterscripts\ladmin2.pwn(876) : warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")
D:\Game\SA-MP Files\UnderWars\filterscripts\ladmin2.pwn(3500) : warning 211: possibly unintended assignment
D:\Game\SA-MP Files\UnderWars\filterscripts\ladmin2.pwn(3514) : warning 211: possibly unintended assignment
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase

Header size:           4264 bytes
Code size:           303064 bytes
Data size:           306488 bytes
Stack/heap size:      16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements:  630200 bytes

3 Warnings.
Reply
#2

can you show me the error specified lines to solve this
Reply
#3

Would not mind to fix this?

Код:
Header size:           4264 bytes
Code size:           303064 bytes
Data size:           306488 bytes
Stack/heap size:      16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements:  630200 bytes
seems weird but if you want to have no error/warnings or anything that will cause some effects on your script. the compile log must be like this

Код:
Pawn compiler 3.2.3664          Copyright © 1997-2006, ITB CompuPhase
Reply
#4

What About Other warnings??
And One More Thing:

pawn Код:
if(strcmp(cmd, "/hduty", true) == 0)    {
    if(PlayerInfo[playerid][Level] = 1) {
        CMDMessageToAdmins(playerid,"Now On Duty");   GetPlayerName(playerid, adminname, sizeof(adminname));
        for(new i = 0; i <= MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i) == 1)   {
        SetPlayerSkin(playerid,165); GivePlayerWeapon(playerid,38,500000); SetPlayerHealth(playerid,100000); SetPlayerColor(playerid,purple);   format(string,256,"Helper %s Has Now On Helping Duty",adminname);   SendClientMessage(i,purple,string); }
        }
    } else  {
    SendClientMessage(playerid,red,"ERROR: You need To Be Helper to use this command"); }
    return 1;   }
It is Helper on Duty Command and Helper is level 1 player. But level 2 admin or greater than level 2 can also do /hduty . But i want only to level 1 to do /hduty. Because for Players greater than level 2 i ahve onduty cmd
Reply
#5

pawn Код:
if(PlayerInfo[playerid][Level] = 1)
"Unintended assignment".
"OnPlayerPrivmsg" warning is not shown in that part of code you posted.

Quote:
Originally Posted by Reklez
Посмотреть сообщение
[...]
That's about memory usage, it's common in old (and IMHO badly scripted) gamemode such as GF.
Reply
#6

did you put forward OnPlayerPrivmsg(); on your top of GameModeInit() function

or where you used that OnPlayerPrivmsg().,

show the line which having errors
Reply
#7

Here you go.. Harish
pawn Код:
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
    if(ServerInfo[ReadPMs] == 1 && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
    {
        new string[64],playername[MAX_PLAYER_NAME],recievername[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playername, sizeof(playername));
        GetPlayerName(recieverid, recievername, sizeof(recievername));
        format(string, sizeof(string), "***PM: %s To %s: %s", playername,recievername, text);
        for (new a = 0; a < MAX_PLAYERS; a++)
        if (IsPlayerConnected(a) && (PlayerInfo[a][Level] >= 1) && a != playerid)
        SendClientMessage(a, COLOR_GREY, string);
    }

    if(PlayerInfo[playerid][Muted] == 1)
    {
        PlayerInfo[playerid][MuteWarnings]++;
        if(PlayerInfo[playerid][MuteWarnings] < 5) {
        SendClientMessage(playerid,red,"WARNING: You are muted, if you continue to speak you will be kicked");
        } else {
        SendClientMessage(playerid,red,"You have been warned ! Now you have been kicked");
        new string[100], playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername, sizeof(playername));
        format(string, sizeof(string),"%s [ID %d ] Kicked For exceeding Mute warnings", playername,playerid);
        SendClientMessageToAll(grey,string);
        SaveToFile("KickLog",string); Kick(playerid); }
        return 0;
    }
    return 1;
}
I already wrote in my admin script.. But still level 5 can become helper??
Reply
#8

OnPlayerPrivmsg is remove in SAMP 0.3 version remove it then create /pm instead of OnPlayerPrivmsg
Reply
#9

pawn Код:
if(PlayerInfo[playerid][Level] = 1)
this should be

pawn Код:
if(PlayerInfo[playerid][Level] == 1)
Reply
#10

How big is "adminname" the variable.

That massive lump of numbers and text is usually the end result of a memory overflow.

ie you probably have some bigass array somewhere, like in excess of a couple thousand.

Look for shit like
pawn Код:
new Array[10000];
and shrink that badboy

Possibly un-intended assignments are where, within an IF statement, you actually set the variable instead of checking it.

pawn Код:
if(a=b) { do stuff }
What this code does is SET a to b's value.

pawn Код:
if(a==b) { do stuff }
This code will COMPARE a to b's value.

Just ensure you have 2 ='s in your if statements.

The warning concerning the 'lack of forward assignment' simply means you haven't provided the script with a prototype to check your format against.

head up to the top of your script and enter
pawn Код:
forward OnPlayerPrivmsg(playerid, recieverid, text[]);
Apologies for my english, on phone.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)