aduty Command errors
#1

I got this errors from making "/aduty" command on my script:

pawn Код:
C:\DOCUME~1\winxp\Desktop\GRANDC~1.6(X\GAMEMO~1\GCRP_N~1.PWN(28683) : error 017: undefined symbol "adminlabel"
C:\DOCUME~1\winxp\Desktop\GRANDC~1.6(X\GAMEMO~1\GCRP_N~1.PWN(28683) : warning 215: expression has no effect
C:\DOCUME~1\winxp\Desktop\GRANDC~1.6(X\GAMEMO~1\GCRP_N~1.PWN(28683) : error 001: expected token: ";", but found "]"
C:\DOCUME~1\winxp\Desktop\GRANDC~1.6(X\GAMEMO~1\GCRP_N~1.PWN(28683) : error 029: invalid expression, assumed zero
C:\DOCUME~1\winxp\Desktop\GRANDC~1.6(X\GAMEMO~1\GCRP_N~1.PWN(28683) : fatal error 107: too many error messages on one line

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


4 Errors.
This is the CMD on my script .. is something wrong on it?
pawn Код:
CMD:aduty(playerid,params[]){
    new string[128];
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_WHITE,"You're not an admin!");
    if(PlayerInfo[playerid][pAdminDuty] == 0)
    {
        format(string,sizeof(string),"%s has just went on Admin Duty",GetName(playerid));
        SendClientMessageToAll(COLOR_GREEN,string);
        SetPlayerHealth(playerid, 100000);
        SetPlayerArmour(playerid, 100000);
        SetPlayerColor(playerid,COLOR_TWRED);
        PlayerInfo[playerid][pAdminDuty] = 1;
        adminlabel[playerid] = Create3DTextLabel("Admin on duty\n Do Not Attack!", COLOR_WHITE, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(adminlabel[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else
    if(PlayerInfo[playerid][pAdminDuty] == 1)
    {
        format(string,sizeof(string),"%s has just went off Admin Duty",GetName(playerid));
        SendClientMessageToAll(COLOR_RED,string);
        PlayerInfo[playerid][pAdminDuty] = 0;
        ResetPlayerWeapons(playerid);
        SetPlayerColor(playerid,COLOR_WHITE);
        SetPlayerHealth(playerid,0);
        ForceClassSelection(playerid);
        Delete3DTextLabel(adminlabel[playerid]);
    }
    return 1;
    }
Reply
#2

add this above
pawn Код:
new adminlabel[MAX_PLAYERS];
CMD:aduty(playerid,params[])
any other errors?
if yes tell me it.
Reply
#3

Yes this is the errors:

pawn Код:
E:\Grand City Roleplay Indonesia Ver.2.6(x)\gamemodes\NGRP_nomysql.pwn(28675) : error 003: declaration of a local variable must appear in a compound block
E:\Grand City Roleplay Indonesia Ver.2.6(x)\gamemodes\NGRP_nomysql.pwn(28676) : error 010: invalid function or declaration
E:\Grand City Roleplay Indonesia Ver.2.6(x)\gamemodes\NGRP_nomysql.pwn(28677) : error 010: invalid function or declaration
E:\Grand City Roleplay Indonesia Ver.2.6(x)\gamemodes\NGRP_nomysql.pwn(28688) : error 010: invalid function or declaration
E:\Grand City Roleplay Indonesia Ver.2.6(x)\gamemodes\NGRP_nomysql.pwn(28689) : error 010: invalid function or declaration
E:\Grand City Roleplay Indonesia Ver.2.6(x)\gamemodes\NGRP_nomysql.pwn(28700) : error 010: invalid function or declaration
E:\Grand City Roleplay Indonesia Ver.2.6(x)\gamemodes\NGRP_nomysql.pwn(85442) : warning 203: symbol is never used: "adminlabel"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.
Reply
#4

What about this? [removed the textlabel]

pawn Код:
CMD:aduty(playerid,params[]){
    new string[128];
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_WHITE,"You're not an admin!");
    if(PlayerInfo[playerid][pAdminDuty] == 0)
    {
        format(string,sizeof(string),"%s has just went on Admin Duty",GetName(playerid));
        SendClientMessageToAll(COLOR_GREEN,string);
        SetPlayerHealth(playerid, 100000);
        SetPlayerArmour(playerid, 100000);
        SetPlayerColor(playerid,COLOR_TWRED);
        PlayerInfo[playerid][pAdminDuty] = 1;
    }
    else
    if(PlayerInfo[playerid][pAdminDuty] == 1)
    {
        format(string,sizeof(string),"%s has just went off Admin Duty",GetName(playerid));
        SendClientMessageToAll(COLOR_RED,string);
        PlayerInfo[playerid][pAdminDuty] = 0;
        ResetPlayerWeapons(playerid);
        SetPlayerColor(playerid,COLOR_WHITE);
        SetPlayerHealth(playerid,0);
        ForceClassSelection(playerid);
    }
    return 1;
    }
Reply
#5

Quote:
Originally Posted by Stanford
Посмотреть сообщение
What about this? [removed the textlabel]

pawn Код:
CMD:aduty(playerid,params[]){
    new string[128];
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_WHITE,"You're not an admin!");
    if(PlayerInfo[playerid][pAdminDuty] == 0)
    {
        format(string,sizeof(string),"%s has just went on Admin Duty",GetName(playerid));
        SendClientMessageToAll(COLOR_GREEN,string);
        SetPlayerHealth(playerid, 100000);
        SetPlayerArmour(playerid, 100000);
        SetPlayerColor(playerid,COLOR_TWRED);
        PlayerInfo[playerid][pAdminDuty] = 1;
    }
    else
    if(PlayerInfo[playerid][pAdminDuty] == 1)
    {
        format(string,sizeof(string),"%s has just went off Admin Duty",GetName(playerid));
        SendClientMessageToAll(COLOR_RED,string);
        PlayerInfo[playerid][pAdminDuty] = 0;
        ResetPlayerWeapons(playerid);
        SetPlayerColor(playerid,COLOR_WHITE);
        SetPlayerHealth(playerid,0);
        ForceClassSelection(playerid);
    }
    return 1;
    }
Its working thanks... but anyway, after i used the command why i got marked on minimap ?
Can you give me help again for this one i will give you +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)