2 Annoying warnings on my /me command
#1

Well I have this problem and it quite irritates me
Defines
PHP код:
//-------COLORS-------//
#define COLOR_WHITE 0xFFFFFFAA
#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_PURPLE 0x800080FF
#define COLOR_RED 0xFF0000FF
#define team_SASF   1
#define team_Terrorist  2
#define timer
#define pName PlayerName
#define ProxDetector
new PlayerInfo[MAX_PLAYERS][pInfo];
new 
gPlayerLogged[MAX_PLAYERS];
new 
sendername[MAX_PLAYER_NAME];
new 
idx 1


Code:
PHP код:
    if(strcmp("/me",cmdtexttrue,10) == 0)
    {
    new 
MEG[128];
        if(
IsPlayerConnected(playerid))// LINE 353
        
{
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You havent logged in yet !");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            new 
length strlen(cmdtext);
            while ((
idx length) && (cmdtext[idx] <= ' '))
            {
                
idx++;
            }
            new 
offset idx;
            new 
result[96];
            while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
            {
                
result[idx offset] = cmdtext[idx];
                
idx++;
            }
            
result[idx offset] = EOS;
            if(!
strlen(result))
            {
                
SendClientMessage(playeridCOLOR_WHITE"USAGE: /me [action]");
                return 
1;
            }
            if(
PlayerInfo[playerid][pMask] == 1)
            {
                
format(MEGsizeof(MEG), "* Stranger %s"result);
            }
            else
            {
                
format(MEGsizeof(MEG), "* %s %s"sendernameresult);
            }
            
ProxDetector(30.0playeridMEGCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); //line 387
        
}
    }
    return 
0;


Warnings:
Код:
C:\Users\Eigenaar\Documents\Erdem\2\gamemodes\DayZ.pwn(353) : warning 217: loose indentation
C:\Users\Eigenaar\Documents\Erdem\2\gamemodes\DayZ.pwn(387) : warning 215: expression has no effect
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Reply
#2

Where are those lines ? 358 an 387 mark them please.
Reply
#3

Код:
C:\Users\Eigenaar\Documents\Erdem\2\gamemodes\DayZ.pwn(353) : warning 217: loose indentation
make a TAB at
pawn Код:
new MEG[128]
making it above the 'if'.

Код:
C:\Users\Eigenaar\Documents\Erdem\2\gamemodes\DayZ.pwn(387) : warning 215: expression has no effect
Can you post only that line?
Reply
#4

Done.
Other Warning:
PHP код:
ProxDetector(30.0playeridMEGCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
First warning is fixed, but the 387 isnt "above"
Reply
#5

Just to clarify, you do have the code for the ProxDetector, right?
Reply
#6

What do you mean?
I only have #define ProxDetector
nothing else
Reply
#7

Quote:
Originally Posted by R4mpage
Посмотреть сообщение
What do you mean?
I only have #define ProxDetector
nothing else
Do not use define to all undefined symbols you get - it's wrong.

******: samp proxdetector and you'll find some results. Edit it to your needs and you're done.
Reply
#8

Konstantinos, Can I have your skype, so when i need help i can just skype you? Since you are one of the best scripters You helped all my problems +REP
Reply
#9

This is a code I found in this forum (I'm sorry I could not find the topic)
pawn Код:
stock SendRangedMessage(sourceid, color, message[], Float:range)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(sourceid, x, y, z);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerVirtualWorld(sourceid) == GetPlayerVirtualWorld(i))
            {
                if(IsPlayerInRangeOfPoint(i, range, x, y, z))
                {
                    SendClientMessage(i, color, message);
                }
            }
        }
    }
    return 1;
}
It's better than ProxDetector
Reply
#10

How to use it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)