whats wrong ??
#1

I have got this from another thread and tried to make into filterscript to work with ladmin, but i cant do it ,
can someone tell me where its gone wrong im guessing ive got it totally wrong

code i robbed i just need it to work with ladmin
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#define PlayerInfo
#include <a_samp>

#if defined FILTERSCRIPT
new Text3D:ADMIN;
public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}
ADMIN = Create3DTextLabel("Admin ON-DUTY", 0xFFFFFFFF, 999.99, 999.99, 999.99 )
public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif



public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/adminduty", true) == 0 || strcmp(cmdtext, "/aduty", true) == 0)
{
    new PlayerText3D: textAdmin;
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][ladmin] > 0)
        {
            if(AdminDuty[playerid] == 0)
            {
                AdminDuty[playerid] = 1;
                SetPlayerSkin(playerid,0);
                SetPlayerArmour(playerid, 999);
                SetPlayerHealth(playerid, 999);
                SetPlayerColor(playerid,TEAM_ADMIN_COLOR);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                textAdmin = Attach3DTextLabelToPlayer( ADMIN, playerid, 0.0, 0.0, 3.0 );
                format(string, sizeof(string), "Admin [ID: %d] %s is now ON duty",playerid, sendername);
                SendClientMessageToAll(COLOR_RED,string);
                return 1;
            }
            else if(AdminDuty[playerid] == 1)
            {
                AdminDuty[playerid] = 0;
                SetPlayerSkin(playerid,PlayerInfo[playerid][pModel]);
                SetPlayerArmour(playerid, 0);
                SetPlayerHealth(playerid, 100);
                SetPlayerToTeamColor(playerid);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                DeletePlayer3DTextLabel( playerid, textAdmin );
                format(string, sizeof(string), "Admin [ID: %d] %s is now OFF duty",playerid, sendername);
                SendClientMessageToAll(COLOR_WHITE,string);
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You Are Not Admin");
            return 1;
        }
    }
    return ( 1 );
}
}
Errors
pawn Код:
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\filterscripts\aduty.pwn(17) : error 010: invalid function or declaration
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\filterscripts\aduty.pwn(43) : error 029: invalid expression, assumed zero
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\filterscripts\aduty.pwn(43) : warning 215: expression has no effect
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\filterscripts\aduty.pwn(43) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\filterscripts\aduty.pwn(43) : error 029: invalid expression, assumed zero
C:\Documents and Settings\BaLLy\Desktop\LONG HAUL TRUCKING\filterscripts\aduty.pwn(43) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
EDIT: i think i no why the the text is not working because i have it in wrong area
Reply
#2

hi bally

1 - line 17)missing ; on
ADMIN = Create3DTextLabel("Admin ON-DUTY", 0xFFFFFFFF, 999.99, 999.99, 999.99 )

checking the other...
Reply
#3

oh hai ill pm you
Reply
#4

pawn Код:
ADMIN = Create3DTextLabel("Admin ON-DUTY", 0xFFFFFFFF, 999.99, 999.99, 999.99 );
//and why the hell you got return ( 1 );
return ( 1 ); TO return 1;
Reply
#5

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#define PlayerInfo
#include <a_samp>

#if defined FILTERSCRIPT
new Text3D:ADMIN;
public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}
ADMIN = Create3DTextLabel("Admin ON-DUTY", 0xFFFFFFFF, 999.99, 999.99, 999.99 );
public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif



public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/adminduty", true) == 0 || strcmp(cmdtext, "/aduty", true) == 0)
{
    new PlayerText3D: textAdmin;
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][ladmin] > 0)
        {
            if(AdminDuty[playerid] == 0)
            {
                AdminDuty[playerid] = 1;
                SetPlayerSkin(playerid,0);
                SetPlayerArmour(playerid, 999);
                SetPlayerHealth(playerid, 999);
                SetPlayerColor(playerid,TEAM_ADMIN_COLOR);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                textAdmin = Attach3DTextLabelToPlayer( ADMIN, playerid, 0.0, 0.0, 3.0 );
                format(string, sizeof(string), "Admin [ID: %d] %s is now ON duty",playerid, sendername);
                SendClientMessageToAll(COLOR_RED,string);
                return 1;
            }
            else if(AdminDuty[playerid] == 1)
            {
                AdminDuty[playerid] = 0;
                SetPlayerSkin(playerid,PlayerInfo[playerid][pModel]);
                SetPlayerArmour(playerid, 0);
                SetPlayerHealth(playerid, 100);
                SetPlayerToTeamColor(playerid);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                DeletePlayer3DTextLabel( playerid, textAdmin );
                format(string, sizeof(string), "Admin [ID: %d] %s is now OFF duty",playerid, sendername);
                SendClientMessageToAll(COLOR_WHITE,string);
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You Are Not Admin");
            return 1;
        }
    }
    return 1;
}
}
Reply
#6

pawn Код:
//#define PlayerInfo  //WTF????!
#include <a_samp>
#include <streamer>

new Text3D:ADMIN[MAX_PLAYERS], AdminDuty[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    ADMIN[playerid] = CreateDynamic3DTextLabel("_", 0xFFFFFF00, 0.0, 0.0, 0.5, 150.0, playerid, INVALID_VEHICLE_ID);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    DestroyDynamic3DTextLabel(ADMIN[playerid]);
    return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/adminduty", true) || !strcmp(cmdtext, "/aduty", true))
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][Level] > 0)
            {
                new str[128];
                if(AdminDuty[playerid] == 0)
                {
                    AdminDuty[playerid] = 1;
                    SetPVarInt(playerid, "SAVEDskin", GetPlayerSkin(playerid));
                    SetPlayerSkin(playerid, 0);
                    SetPlayerArmour(playerid, 999.0);
                    SetPlayerHealth(playerid, 999.0);
                    GetPlayerName(playerid, str, sizeof(str));
                    UpdateDynamic3DTextLabelText(ADMIN[playerid], 0xFFFFFFFF, "Admin ON-DUTY");
                    format(str, sizeof(str), "Admin [ID: %d] %s is now ON duty",playerid, str);
                    SendClientMessageToAll(COLOR_RED,str);
                    return 1;
                }
                else if(AdminDuty[playerid] == 1)
                {
                    AdminDuty[playerid] = 0;
                    SetPlayerSkin(playerid, GetPVarInt(playerid, "SAVEDskin"));
                    SetPlayerArmour(playerid, 0.0);
                    SetPlayerHealth(playerid, 100.0);
                    GetPlayerName(playerid, str, sizeof(str));
                    UpdateDynamic3DTextLabelText(ADMIN[playerid], 0xFFFFFF00, "_");
                    format(str, sizeof(str), "Admin [ID: %d] %s is now OFF duty", playerid, str);
                    SendClientMessageToAll(COLOR_WHITE,str);
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "You Are Not Admin");
                return 1;
            }
        }
        return 1;
    }
    return 0;
}
Remember to add this in LAdmin... It won't work as a separate filterscript!
It also uses Incognito's Streamer plugin
Reply
#7

Quote:
Originally Posted by OPremium
Посмотреть сообщение
pawn Код:
//#define PlayerInfo  //WTF????!
#include <a_samp>
#include <streamer>

new Text3D:ADMIN[MAX_PLAYERS], AdminDuty[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    ADMIN[playerid] = CreateDynamic3DTextLabel("_", 0xFFFFFF00, 0.0, 0.0, 0.5, 150.0, playerid, INVALID_VEHICLE_ID);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    DestroyDynamic3DTextLabel(ADMIN[playerid]);
    return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/adminduty", true) || !strcmp(cmdtext, "/aduty", true))
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][Level] > 0)
            {
                new str[128];
                if(AdminDuty[playerid] == 0)
                {
                    AdminDuty[playerid] = 1;
                    SetPVarInt(playerid, "SAVEDskin", GetPlayerSkin(playerid));
                    SetPlayerSkin(playerid, 0);
                    SetPlayerArmour(playerid, 999.0);
                    SetPlayerHealth(playerid, 999.0);
                    GetPlayerName(playerid, str, sizeof(str));
                    UpdateDynamic3DTextLabelText(ADMIN[playerid], 0xFFFFFFFF, "Admin ON-DUTY");
                    format(str, sizeof(str), "Admin [ID: %d] %s is now ON duty",playerid, str);
                    SendClientMessageToAll(COLOR_RED,str);
                    return 1;
                }
                else if(AdminDuty[playerid] == 1)
                {
                    AdminDuty[playerid] = 0;
                    SetPlayerSkin(playerid, GetPVarInt(playerid, "SAVEDskin"));
                    SetPlayerArmour(playerid, 0.0);
                    SetPlayerHealth(playerid, 100.0);
                    GetPlayerName(playerid, str, sizeof(str));
                    UpdateDynamic3DTextLabelText(ADMIN[playerid], 0xFFFFFF00, "_");
                    format(str, sizeof(str), "Admin [ID: %d] %s is now OFF duty", playerid, str);
                    SendClientMessageToAll(COLOR_WHITE,str);
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "You Are Not Admin");
                return 1;
            }
        }
        return 1;
    }
    return 0;
}
Remember to add this in LAdmin... It won't work as a separate filterscript!
It also uses Incognito's Streamer plugin
OMFG What's that shit=>
ADMIN[playerid] = CreateDynamic3DTextLabel("_", 0xFFFFFF00, 0.0, 0.0, 0.5, 150.0, playerid, INVALID_VEHICLE_ID);
Reply
#8

it crashed ladmin in pawno.
Reply
#9

Don't use this CreateDynamic3DTextLabel
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)