SA-MP Forums Archive
Little indent problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Little indent problem (/showthread.php?tid=274289)



Little indent problem - kingchandio - 05.08.2011

can you tell me where i am mistaking?
Error:
Quote:

D:\Games\ELRPv1\gamemodes\ELRP.pwn(215) : error 010: invalid function or declaration
D:\Games\ELRPv1\gamemodes\ELRP.pwn(21 : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

pawn Код:
public OnPlayerText(playerid, text[])

        {
        new pname[24], str[128];
        GetPlayerName(playerid, pname, 24);
        format(str, sizeof(str), "%s Says: %s", pname, text);
        ProxDetector(10.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
        return 0;
        }

        if PlayerInfo[playerid][pNMuted] == 1)
        {
        SendClientMessage(playerid,0xFF0000,"ERROR: You are muted!");
        return 0;
    }



Re: Little indent problem - Riddick94 - 05.08.2011

Um?! LMAO xD

pawn Код:
public OnPlayerText(playerid, text[])
{
    if PlayerInfo[playerid][pNMuted])
    {
        SendClientMessage(playerid,0xFF0000,"ERROR: You are muted!")
        return false;
    }

    new pname[24], str[128];
    GetPlayerName(playerid, pname, 24);
    format(str, sizeof(str), "%s Says: %s", pname, text);
    ProxDetector(10.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return false;
}



Re: Little indent problem - kingchandio - 05.08.2011

Quote:

D:\Games\ELRPv1\gamemodes\ELRP.pwn(207) : error 001: expected token: "*then", but found ")"
D:\Games\ELRPv1\gamemodes\ELRP.pwn(207) : error 029: invalid expression, assumed zero
D:\Games\ELRPv1\gamemodes\ELRP.pwn(210) : error 001: expected token: ";", but found "return"
D:\Games\ELRPv1\gamemodes\ELRP.pwn(213) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

again


Re: Little indent problem - Riddick94 - 05.08.2011

pawn Код:
#include    "a_samp"

public OnPlayerText(playerid, text[])
{
    if PlayerInfo[playerid][pNMuted])
    {
        SendClientMessage(playerid,0xFF0000,"ERROR: You are muted!");
        return false;
    }

    new pname[24], str[128];
    GetPlayerName(playerid, pname, 24);
    format(str, sizeof(str), "%s Says: %s", pname, text);
    ProxDetector(10.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return false;
}



Re: Little indent problem - kingchandio - 05.08.2011

fixed by my self by but thanks
pawn Код:
public OnPlayerText(playerid, text[])
{
    if (PlayerInfo[playerid][pNMuted] == 1)
    {
        SendClientMessage(playerid,0xFF0000,"ERROR: You are muted!");
        return 0;
    }

    new pname[24], str[128];
    GetPlayerName(playerid, pname, 24);
    format(str, sizeof(str), "%s Says: %s", pname, text);
    ProxDetector(10.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return 0;
}



Re: Little indent problem - Riddick94 - 05.08.2011

I just lost "(" and ";" in here:

pawn Код:
if(PlayerInfo[playerid][pNMuted])
    {
        SendClientMessage(playerid,0xFF0000,"ERROR: You are muted!");
You fixed it.. okey


Re: Little indent problem - kingchandio - 05.08.2011

another thing i want to do this
pawn Код:
if(!IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pHelper] >= 2 ) return SendClientMessage(playerid, 0xFF4646FF, "You are not authorized to use that command !");
instead of this
pawn Код:
if(!IsPlayerAdmin(playerid)) return 1;
but its not working whats wrong with it?


Re: Little indent problem - Riddick94 - 05.08.2011

You wan't still to use IsPlayerAdmin(playerid), yes?

You won't player [pHelper] and [pAdmin] with level 2 or greater use this command. Change >= to <= if you wan't to let players with greater levels or 2 use this.

pawn Код:
if(!IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] < 2 || PlayerInfo[playerid][pHelper] < 2)
{
    SendClientMessage(playerid, 0xFF4646FF, "You are not authorized to use that command !");
    return true;
}



Re: Little indent problem - kingchandio - 05.08.2011

its not working it is keep saying You are not authorized to use that command ... help


Re: Little indent problem - WoodPecker - 05.08.2011

/rcon login [password] so you can connect as admin , InPlayerAdmin = RCON admin