Little coding help
#1

Hi, I am getting these errors for my /aduty command,

C:\Users\Parent\Downloads\tmp_fm_NGRP2 (2).pwn(41240 -- 41242) : error 001: expected token: ",", but found ";"
C:\Users\Parent\Downloads\tmp_fm_NGRP2 (2).pwn(41242) : error 029: invalid expression, assumed zero
C:\Users\Parent\Downloads\tmp_fm_NGRP2 (2).pwn(41242 -- 41243) : error 029: invalid expression, assumed zero
C:\Users\Parent\Downloads\tmp_fm_NGRP2 (2).pwn(41242 -- 41243) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

And this is the scripting of the /aduty command.


CMD:aduty(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 0) return SendClientMessage(playerid, -1, "This is an admin only command!");
if(PlayerInfo[playerid][pAdminDuty] == 0)
{

SendClientMessageEx(playerid, COLOR_YELLOW, "You are now on administrative duty! Remember to check /reports!");
//SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
PlayerInfo[playerid][pAdminDuty] = 1;
SetPlayerHealth(playerid, 100000);
SetPlayerArmour(playerid, 100000);
SetPlayerColor(playerid, 0xFF550000);
new string[128];
PlayerInfo[playerid][pTogReports] = 0;
format(string, sizeof(string), "Administrator %s is now on Admin Duty! (Is Now OOC)", GetPlayerNameEx(playerid));
ABroadCast(COLOR_LIGHTRED, string, 1);

if PlayerInfo[playerid][pAdminDuty] == 1*then
SetPlayerColor(playerid,0xFF66FF00);
format(string, sizeof(string),"[ADMIN]: %s is now on Admin Duty",
ABroadCast(COLOR_LIGHTRED, string, 1),
DutyLabel playerid; = Create3DTextLabel("Admin On Duty \n Do NOT Attack",0xFF000099,0,0,0,50,-1,1),
Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);
}
else
{
SendClientMessageEx(playerid, COLOR_RED, "You are now off admin duty!");
new string[128];
format(string, sizeof(string), "Administrator %s is now off Admin Duty!", GetPlayerNameEx(playerid));
ABroadCast(COLOR_LIGHTRED, string, 1);
PlayerInfo[playerid][pTogReports] = 1;
//SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
PlayerInfo[playerid][pAdminDuty] = 0;
}
return 1;
}
Thanks for any help
Reply
#2

Maybe use PAWN BBCode next time..
pawn Код:
CMD:aduty(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 0) return SendClientMessage(playerid, -1, "This is an admin only command!");
    if(PlayerInfo[playerid][pAdminDuty] == 0)
    {

        SendClientMessageEx(playerid, COLOR_YELLOW, "You are now on administrative duty! Remember to check /reports!");
        //SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
        PlayerInfo[playerid][pAdminDuty] = 1;
        SetPlayerHealth(playerid, 100000);
        SetPlayerArmour(playerid, 100000);
        SetPlayerColor(playerid, 0xFF550000);
        new string[128];
        PlayerInfo[playerid][pTogReports] = 0;
        format(string, sizeof(string), "Administrator %s is now on Admin Duty! (Is Now OOC)", GetPlayerNameEx(playerid));
        ABroadCast(COLOR_LIGHTRED, string, 1);

        if PlayerInfo[playerid][pAdminDuty] == 1*then
        SetPlayerColor(playerid,0xFF66FF00),
        format(string, sizeof(string),"[ADMIN]: %s is now on Admin Duty", GetPlayerNameEx(playerid)),
        ABroadCast(COLOR_LIGHTRED, string, 1),
        DutyLabel playerid; = Create3DTextLabel("Admin On Duty \n Do NOT Attack",0xFF000099,0,0,0,50,-1,1),
        Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_RED, "You are now off admin duty!");
        new string[128];
        format(string, sizeof(string), "Administrator %s is now off Admin Duty!", GetPlayerNameEx(playerid));
        ABroadCast(COLOR_LIGHTRED, string, 1);
        PlayerInfo[playerid][pTogReports] = 1;
        //SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 0);
        PlayerInfo[playerid][pAdminDuty] = 0;
    }
    return 1;
}
Reply
#3

Thanks, Help still appreciated
Reply
#4

Quote:
Originally Posted by Casper001
Посмотреть сообщение
Thanks, Help still appreciated
You're welcome, is for this reason that we are here
Reply
#5

Sorry, bump. Any help? The start of the CMD Is line 41220 Just if you need that
Reply
#6

pawn Код:
CMD:aduty(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 0) return SendClientMessage(playerid, -1, "This is an admin only command!");
    if(PlayerInfo[playerid][pAdminDuty] == 0)
    {

        SendClientMessageEx(playerid, COLOR_YELLOW, "You are now on administrative duty! Remember to check /reports!");
        //SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
        PlayerInfo[playerid][pAdminDuty] = 1;
        SetPlayerHealth(playerid, 100000);
        SetPlayerArmour(playerid, 100000);
        SetPlayerColor(playerid, 0xFF550000);
        new string[128];
        PlayerInfo[playerid][pTogReports] = 0;
        format(string, sizeof(string), "Administrator %s is now on Admin Duty! (Is Now OOC)",              
        GetPlayerNameEx(playerid));
        ABroadCast(COLOR_LIGHTRED, string, 1);

        if PlayerInfo[playerid][pAdminDuty] == 1*then
        SetPlayerColor(playerid,0xFF66FF00),
        format(string, sizeof(string),"[ADMIN]: %s is now on Admin Duty", GetPlayerNameEx(playerid)),
        ABroadCast(COLOR_LIGHTRED, string, 1),
        new Text3D:DutyLabel = Create3DTextLabel("Admin On Duty \n Do NOT Attack",0xFF000099,0,0,0,50,-1,1);
        Attach3DTextLabelToPlayer(DutyLabel, playerid, 0,0,0);
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_RED, "You are now off admin duty!");
        new string[128];
        format(string, sizeof(string), "Administrator %s is now off Admin Duty!", GetPlayerNameEx(playerid));
        ABroadCast(COLOR_LIGHTRED, string, 1);
        PlayerInfo[playerid][pTogReports] = 1;
        //SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 0);
        PlayerInfo[playerid][pAdminDuty] = 0;
    }
    return 1;
}
Reply
#7

No, Sorry that dont work I get 6 errors from Scripting
Reply
#8

Can u give me the line with errors?
Reply
#9

Код:
format(string, sizeof(string),"[ADMIN]: %s is now on Admin Duty",
ABroadCast(COLOR_LIGHTRED, string, 1),
DutyLabel playerid; = Create3DTextLabel("Admin On Duty \n Do NOT Attack",0xFF000099,0,0,0,50,-1,1),
Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);
}
else
{
SendClientMessageEx(playerid, COLOR_RED, "You are now off admin duty!");
new string[128];
That is where the errors are located... I couldnt make it more precsise as I just closed my editor
Reply
#10

Код:
format(string, sizeof(string),"[ADMIN]: %s is now on Admin Duty", GetPlayerNameEx(playerid));
ABroadCast(COLOR_LIGHTRED, string, 1);
DutyLabel playerid; = Create3DTextLabel("Admin On Duty \n Do NOT Attack",0xFF000099,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);
}
else
{
SendClientMessageEx(playerid, COLOR_RED, "You are now off admin duty!");
new string[128];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)