warning 215: expression has no effect
#1

Hello samp forums, got another problem with ProxDetector.

This warning shows - warning 215: expression has no effect

Code:

Код:
public OnPlayerText(playerid, text[])
{
    if (realchat)
        {
            new string[128];
            format(string, sizeof(string), "%s says: %s", GetName(playerid), text);
            ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            format(string, sizeof(string), "says: %s", text);
            ApplyAnimation(playerid,"PED","IDLE_CHAT",2.0,1,0,0,1,1);
            return 0;
        }
	return 1;
}
Reply
#2

Can I pm you and i'll send you my code?
Reply
#3

it says its exactly here ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
Reply
#4

help someone...
Reply
#5

The bloke said there is nothing wrong with the code, but hopefully some guy will assist you fully.

I don't know much about scripting.
Reply
#6

Quote:
Originally Posted by GNewZ
Посмотреть сообщение
The bloke said there is nothing wrong with the code, but hopefully some guy will assist you fully.

I don't know much about scripting.
Thanks captain obvious.
Reply
#7

Show us some snippets nearby the above or the below of this code, so we can help you fix it.
Reply
#8

Код:
#include <a_samp>
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else


main()
{
	print("\n----------------------------------");
	print("Nines");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{

// Player markers only visible to near players
ShowPlayerMarkers(0);
DisableInteriorEnterExits();
EnableStuntBonusForAll(0);
// Don't use these lines if it's a filterscript
SetGameModeText("RP server.");
	
AddPlayerClass(24,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(28,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(29,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(23,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(30,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(46,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(47,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(44,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(144,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(187,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(211,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(250,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
return 1;
}
#define COLOR_GREEN         0x33AA33AA
#define COLOR_GREY          0xAFAFAFAA
#define COLOR_WHITE         0xFFFFFFAA
#define COLOR_YELLOW        0xFFFF00AA
#define COLOR_BLUE          0x0000BBAA
#define COLOR_ORANGE        0xFF9900AA
#define COLOR_RED           0xCC0000AA
#define COLOR_DARKRED 		0x660000AA
#define COLOR_LIGHTGRAY     0xD3D3D3FF
#define RP_CHATS            0xBE9BC1FF
#define COLOR_FADE1 		0xC2A2DAAA
#define COLOR_FADE2 		0xFFFFFFAA
#define COLOR_FADE3 		0xAAAAAAAA
#define COLOR_FADE4 		0x8C8C8C8C
#define COLOR_FADE5 		0x6E6E6E6E
#define COLOR_GREY          0xAFAFAFAA
#define COLOR_LIGHTGRAY     0xD3D3D3FF
#define RP_CHATS            0xBE9BC1FF
new noooc = 0;
new realchat = 1;
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
        if(IsPlayerConnected(playerid))
        {
                new Float:posx, Float:posy, Float:posz;
                new Float:oldposx, Float:oldposy, Float:oldposz;
                new Float:tempposx, Float:tempposy, Float:tempposz;
                GetPlayerPos(playerid, oldposx, oldposy, oldposz);
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                        if(IsPlayerConnected(i))
                        {
                                GetPlayerPos(i, posx, posy, posz);
                                tempposx = (oldposx -posx);
                                tempposy = (oldposy -posy);
                                tempposz = (oldposz -posz);
                                new playerworld, player2world;
                                playerworld = GetPlayerVirtualWorld(playerid);
                                player2world = GetPlayerVirtualWorld(i);
                                if(playerworld == player2world)
                                {
                                        if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                                        {
                                                SendClientMessage(i, col1, string);
                                        }
                                        else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                                        {
                                                SendClientMessage(i, col2, string);
                                        }
                                        else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                                        {
                                                SendClientMessage(i, col3, string);
                                        }
                                        else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                                        {
                                                SendClientMessage(i, col4, string);
                                        }
                                        else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                                        {
                                                SendClientMessage(i, col5, string);
                                        }
                                }
                                else
                                {
                                        SendClientMessage(i, col1, string);
                                }
                        }
                }
        }
        return 1;
}
public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
if(classid == 0) GameTextForPlayer(playerid,"~r~Skin Selection",2000,6);
{
    SetPlayerPos(playerid,1766.1969,-1945.0790,13.5643);
    SetPlayerCameraPos(playerid,1768.5718,-1942.9174,13.5615);
    SetPlayerFacingAngle(playerid,312.7264);
    SetPlayerCameraLookAt(playerid,1766.1969,-1945.0790,13.5643);
}
return 1;
}
public OnPlayerConnect(playerid)
{
PlayAudioStreamForPlayer(playerid, "http://k002.kiwi6.com/LINK*);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"%s has connected to [:..RP server...:]",pName);
SendClientMessageToAll(0x33AA33AA,string);

return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new
        string[64],
        name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    switch(reason)
    {
        case 0: format(string,sizeof string,"%s left [:..RP server..:] (Timed out)",name);
        case 1: format(string,sizeof string,"%s left [:..RP server...:] (Leaving)",name);
        case 2: format(string,sizeof string,"%s left [:..RP server...:] (Kicked/Banned)",name);
    }
    SendClientMessageToAll(0x660000AA,string);

    return 1;
}

public OnPlayerSpawn(playerid)
{
StopAudioStreamForPlayer(playerid);
SetPlayerColor(playerid, COLOR_GREY);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}
public OnPlayerText(playerid, text[])
{
    if (realchat)
        {
            new string[128];
                format(string, sizeof(string), "%s says: %s", GetName(playerid), text);
                ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                format(string, sizeof(string), "says: %s", text);
                ApplyAnimation(playerid,"PED","IDLE_CHAT",2.0,1,0,0,1,1);
                return 0;
        }
        return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/help", true))
{
SendClientMessage(playerid, 0xCC0000AA, "SERVER: List of commands, need more help? Contact a admin");
SendClientMessage(playerid, 0xCC0000AA, "---------------------------------------------------------");
SendClientMessage(playerid, 0xAFAFAFAA, "Animations: /Animlist");
SendClientMessage(playerid, 0xAFAFAFAA, "General CMDS:/DGun /AFK /Buy /Adv /SMS /handshake");
SendClientMessage(playerid, 0xAFAFAFAA, "PM CMDs:/PMSOFF /PMSON /PM [ID] [Message]");
SendClientMessage(playerid, 0xAFAFAFAA, "Admins: /lcommands /level1 /level2 /level3 /level4 /level5");

return 1;
        // Returning 1 informs the server that the command has been processed.
        // OnPlayerCommandText won't be called in other scripts.
    }
return SendClientMessage(playerid,-1,"This Command Doesn't Exist Here");
    // Returning 0 informs the server that the command hasn't been processed by this script.
    // OnPlayerCommandText will be called in other scripts until one returns 1.
    // If no scripts return 1, the 'SERVER: Unknown Command' message will be shown.
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
Reply
#9

This is the fixed code. I added the stock GetName, fixed the parameters of the function PlayAudioStreamForPlayer by adding the quotation which you forgot to add to close a parameter (which is the link for the song) and I closed the public OnPlayerEnterVehicle which was not closed at the end of the file.
pawn Код:
#include <a_samp>
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else


main()
{
    print("\n----------------------------------");
    print("Nines");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{

// Player markers only visible to near players
ShowPlayerMarkers(0);
DisableInteriorEnterExits();
EnableStuntBonusForAll(0);
// Don't use these lines if it's a filterscript
SetGameModeText("RP server.");

AddPlayerClass(24,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(28,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(29,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(23,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(30,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(46,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(47,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(44,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(144,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(187,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(211,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
AddPlayerClass(250,1766.1969,-1945.0790,13.5643,312.7264,0,0,0,0,0,0); // THESPAWN
return 1;
}
#define COLOR_GREEN         0x33AA33AA
#define COLOR_GREY          0xAFAFAFAA
#define COLOR_WHITE         0xFFFFFFAA
#define COLOR_YELLOW        0xFFFF00AA
#define COLOR_BLUE          0x0000BBAA
#define COLOR_ORANGE        0xFF9900AA
#define COLOR_RED           0xCC0000AA
#define COLOR_DARKRED       0x660000AA
#define COLOR_LIGHTGRAY     0xD3D3D3FF
#define RP_CHATS            0xBE9BC1FF
#define COLOR_FADE1         0xC2A2DAAA
#define COLOR_FADE2         0xFFFFFFAA
#define COLOR_FADE3         0xAAAAAAAA
#define COLOR_FADE4         0x8C8C8C8C
#define COLOR_FADE5         0x6E6E6E6E
#define COLOR_GREY          0xAFAFAFAA
#define COLOR_LIGHTGRAY     0xD3D3D3FF
#define RP_CHATS            0xBE9BC1FF
//new noooc = 0;
new realchat = 1;
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
        if(IsPlayerConnected(playerid))
        {
                new Float:posx, Float:posy, Float:posz;
                new Float:oldposx, Float:oldposy, Float:oldposz;
                new Float:tempposx, Float:tempposy, Float:tempposz;
                GetPlayerPos(playerid, oldposx, oldposy, oldposz);
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                        if(IsPlayerConnected(i))
                        {
                                GetPlayerPos(i, posx, posy, posz);
                                tempposx = (oldposx -posx);
                                tempposy = (oldposy -posy);
                                tempposz = (oldposz -posz);
                                new playerworld, player2world;
                                playerworld = GetPlayerVirtualWorld(playerid);
                                player2world = GetPlayerVirtualWorld(i);
                                if(playerworld == player2world)
                                {
                                        if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                                        {
                                                SendClientMessage(i, col1, string);
                                        }
                                        else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                                        {
                                                SendClientMessage(i, col2, string);
                                        }
                                        else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                                        {
                                                SendClientMessage(i, col3, string);
                                        }
                                        else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                                        {
                                                SendClientMessage(i, col4, string);
                                        }
                                        else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                                        {
                                                SendClientMessage(i, col5, string);
                                        }
                                }
                                else
                                {
                                        SendClientMessage(i, col1, string);
                                }
                        }
                }
        }
        return 1;
}
public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
if(classid == 0) GameTextForPlayer(playerid,"~r~Skin Selection",2000,6);
{
    SetPlayerPos(playerid,1766.1969,-1945.0790,13.5643);
    SetPlayerCameraPos(playerid,1768.5718,-1942.9174,13.5615);
    SetPlayerFacingAngle(playerid,312.7264);
    SetPlayerCameraLookAt(playerid,1766.1969,-1945.0790,13.5643);
}
return 1;
}
public OnPlayerConnect(playerid)
{
PlayAudioStreamForPlayer(playerid, "http://k002.kiwi6.com/LINK");
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"%s has connected to [:..RP server...:]",pName);
SendClientMessageToAll(0x33AA33AA,string);

return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new
        string[64],
        name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    switch(reason)
    {
        case 0: format(string,sizeof string,"%s left [:..RP server..:] (Timed out)",name);
        case 1: format(string,sizeof string,"%s left [:..RP server...:] (Leaving)",name);
        case 2: format(string,sizeof string,"%s left [:..RP server...:] (Kicked/Banned)",name);
    }
    SendClientMessageToAll(0x660000AA,string);

    return 1;
}

public OnPlayerSpawn(playerid)
{
StopAudioStreamForPlayer(playerid);
SetPlayerColor(playerid, COLOR_GREY);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}
public OnPlayerText(playerid, text[])
{
    if (realchat)
        {
            new string[128];
            format(string, sizeof(string), "%s says: %s", GetName(playerid), text);
            ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            format(string, sizeof(string), "says: %s", text);
            ApplyAnimation(playerid,"PED","IDLE_CHAT",2.0,1,0,0,1,1);
            return 0;
        }
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/help", true))
{
SendClientMessage(playerid, 0xCC0000AA, "SERVER: List of commands, need more help? Contact a admin");
SendClientMessage(playerid, 0xCC0000AA, "---------------------------------------------------------");
SendClientMessage(playerid, 0xAFAFAFAA, "Animations: /Animlist");
SendClientMessage(playerid, 0xAFAFAFAA, "General CMDS:/DGun /AFK /Buy /Adv /SMS /handshake");
SendClientMessage(playerid, 0xAFAFAFAA, "PM CMDs:/PMSOFF /PMSON /PM [ID] [Message]");
SendClientMessage(playerid, 0xAFAFAFAA, "Admins: /lcommands /level1 /level2 /level3 /level4 /level5");

return 1;
        // Returning 1 informs the server that the command has been processed.
        // OnPlayerCommandText won't be called in other scripts.
    }
return SendClientMessage(playerid,-1,"This Command Doesn't Exist Here");
    // Returning 0 informs the server that the command hasn't been processed by this script.
    // OnPlayerCommandText will be called in other scripts until one returns 1.
    // If no scripts return 1, the 'SERVER: Unknown Command' message will be shown.
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}
stock GetName(playerid)
{
    new string[MAX_PLAYER_NAME];
    GetPlayerName(playerid,string,sizeof(string));
    //strreplace(string,'_',' ');
    return string;
}
Reply
#10

Proper indentation is key in solving scripting errors, by the way. I didn't even look at the code when I saw that you couldn't even indent.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)