Warings | Help
#1

Hey,

i have 7 warings .

Код:
C:\Documents and Settings\Meie Kodu\Desktop\Minu GM\gamemodes\LV-SE.pwn(1290) : warning 209: function "OnPlayerText" should return a value
C:\Documents and Settings\Meie Kodu\Desktop\Minu GM\gamemodes\LV-SE.pwn(2628) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Meie Kodu\Desktop\Minu GM\gamemodes\LV-SE.pwn(2628) : warning 219: local variable "pName" shadows a variable at a preceding level
C:\Documents and Settings\Meie Kodu\Desktop\Minu GM\gamemodes\LV-SE.pwn(2650) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Meie Kodu\Desktop\Minu GM\gamemodes\LV-SE.pwn(2650) : warning 219: local variable "pName" shadows a variable at a preceding level
C:\Documents and Settings\Meie Kodu\Desktop\Minu GM\gamemodes\LV-SE.pwn(2677) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Meie Kodu\Desktop\Minu GM\gamemodes\LV-SE.pwn(2677) : warning 219: local variable "pName" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Warnings.
and this


Код:
public OnPlayerText(playerid)
{
    if(AFKBRB[playerid] == 1) {
	SendClientMessage(playerid,TELEWARN, "ERROR: You are AFK/BRB, so you can't write in chat");
	return 0;
	}
	
/*
public OnPlayerUpdate(playerid)
{
    new name[256];
	if(respond[playerid] == false){
	respond[playerid] = true;
	TogglePlayerControllable(playerid,0);
	GetPlayerName(playerid, aname, sizeof(aname));
	strins(aname,"[AFK]",0, MAX_PLAYER_NAME );
	SetPlayerName(playerid,aname);
	}
	else if(respond[playerid] == true){
	GetPlayerName(playerid, aname, sizeof(aname));
	strdel(aname,0,5);
    SetPlayerName(playerid,aname);
	GetPlayerName(playerid,name, sizeof(name));
	TogglePlayerControllable(playerid,1);
    return 1;
}
public CheckAFK(){
	new i = -1;
	while(++i < MAX_PLAYERS){
	if(!IsPlayerConnected(i)) continue;
	if(respond[i] == false){ // Keel them for being AFK
	}
	else respond[i] = false;
	}
	}*/
//NEW's
/
Код:
#define AFK_TIME 30000

new IsAfkBrb[MAX_PLAYERS];
new IsBack[MAX_PLAYERS];
new AFKBRB[MAX_PLAYERS];
new aname[MAX_PLAYER_NAME];
//new bool:respond[MAX_PLAYERS];
//forward CheckAFK();
/
commands are right, but why i got waring help plz
Reply
#2

correct onplayetext
pawn Код:
public OnPlayerText(playerid)
{
    if(AFKBRB[playerid] == 1)
    {
        SendClientMessage(playerid,TELEWARN, "ERROR: You are AFK/BRB, so you can't write in chat");
        return 0;
    }
    return 1;
}
for the other warnings you have to delete or rename this string and this pName in the line the warning say
add me in msn pyrokar@libero.it i can fix it if u have teamviewer
Reply
#3

Creating a HUGE variable in OPU. I wouldn't recommend doing that. Just use a 1 second timer or so.
Reply
#4

Got fixed!
Thanks to gigi1223
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)