SA-MP Forums Archive
whats wrong ?? - 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)
+--- Thread: whats wrong ?? (/showthread.php?tid=286086)



whats wrong ?? - [LHT]Bally - 26.09.2011

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


Re: whats wrong ?? - CmZxC - 26.09.2011

hi bally

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

checking the other...


Re: whats wrong ?? - [LHT]Bally - 26.09.2011

oh hai ill pm you


Re : whats wrong ?? - Naruto_Emilio - 26.09.2011

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;



Re: whats wrong ?? - Kingunit - 26.09.2011

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;
}
}



Respuesta: whats wrong ?? - OPremium - 26.09.2011

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


Re : Respuesta: whats wrong ?? - Naruto_Emilio - 26.09.2011

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);


Re: whats wrong ?? - [LHT]Bally - 26.09.2011

it crashed ladmin in pawno.


Re: whats wrong ?? - Kostas' - 26.09.2011

Don't use this CreateDynamic3DTextLabel