Error : possibly unintended assignment
#1

Im having some warnings...im beginner so idk why...the script is dahley's im only re-editing it...

PHP код:
#include <a_samp>
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_BLUE 0x33CCFFAA
#define FILTERSCRIPT
new Float:naty[500];
new 
Float:positions[MAX_PLAYERS][3];
new 
PlayerIsAFK[MAX_PLAYERS];
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/afk"true))
    {
    if 
PlayerIsAFK[playerid] = 0*then
    
{
        new 
pName[MAX_PLAYER_NAME];
        new 
string[128];
        
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        
format(stringsizeof(string), "--) %s Has entered AFK mode."pName);
        
SendClientMessage(playerid,COLOR_YELLOW"You are now in AFK mode. Use /back to go back!");
        
SendClientMessageToAll(COLOR_YELLOWstring);
        
TogglePlayerControllable(playerid0);
        
GetPlayerHealth(playeridnaty[playerid]);
        
GetPlayerPos(playeridpositions[playerid][0], positions[playerid][1], positions[playerid][2]);
        
SetPlayerPos(playerid2879.5769,2523.5569,10.8203);
        
SetPlayerHealth(playerid999999999999999.99);
        
PlayerIsAFK[playerid] = 1;
        return 
1;
    }
    }
    if(
strcmp(cmdtext"/back"true) == 0)
    {
    if 
PlayerIsAFK[playerid] = 1*then
    
{
        new 
pName[MAX_PLAYER_NAME];
        new 
string[128];
        
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        
format(stringsizeof(string), "--) %s Is now back."pName);
        
SendClientMessageToAll(COLOR_YELLOWstring);
        
TogglePlayerControllable(playerid1);
        
SetPlayerHealth(playeridnaty[playerid]);
        
SetPlayerPos(playeridpositions[playerid][0], positions[playerid][1], positions[playerid][2]);
        
PlayerIsAFK[playerid] = 0;
    }
    return 
1;
    }
    return 
0;

ERRORS

PHP код:
C:\Documents and Settings\scry\My Documents\Downloads\AFKsystemv2.pwn(15) : warning 211possibly unintended assignment
C
:\Documents and Settings\scry\My Documents\Downloads\AFKsystemv2.pwn(34) : warning 211possibly unintended assignment
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
2 Warnings

Reply
#2

Try:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/afk", true))
    {
    if (PlayerIsAFK[playerid] == 0)
    {
        new pName[MAX_PLAYER_NAME];
        new string[128];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        format(string, sizeof(string), "--) %s Has entered AFK mode.", pName);
        SendClientMessage(playerid,COLOR_YELLOW, "You are now in AFK mode. Use /back to go back!");
        SendClientMessageToAll(COLOR_YELLOW, string);
        TogglePlayerControllable(playerid, 0);
        GetPlayerHealth(playerid, naty[playerid]);
        GetPlayerPos(playerid, positions[playerid][0], positions[playerid][1], positions[playerid][2]);
        SetPlayerPos(playerid, 2879.5769,2523.5569,10.8203);
        SetPlayerHealth(playerid, 999999999999999.99);
        PlayerIsAFK[playerid] = 1;
        return 1;
    }
    }
    if(strcmp(cmdtext, "/back", true) == 0)
    {
    if (PlayerIsAFK[playerid] == 1)
    {
        new pName[MAX_PLAYER_NAME];
        new string[128];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        format(string, sizeof(string), "--) %s Is now back.", pName);
        SendClientMessageToAll(COLOR_YELLOW, string);
        TogglePlayerControllable(playerid, 1);
        SetPlayerHealth(playerid, naty[playerid]);
        SetPlayerPos(playerid, positions[playerid][0], positions[playerid][1], positions[playerid][2]);
        PlayerIsAFK[playerid] = 0;
    }
    return 1;
    }
    return 0;
}
Reply
#3

Thanks (EMBARASING ERROR XD) GAVE YOU A REP ANYWAY
Reply
#4

Quote:
Originally Posted by wumpyc
Посмотреть сообщение
Thanks (EMBARASING ERROR XD) GAVE YOU A REP ANYWAY
No prob's, glad i could help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)