PDA

View Full Version : Little coding help


Casper001
04/04/2012, 06:08 PM
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 (c) 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

aRoach
04/04/2012, 06:25 PM
Maybe use PAWN BBCode next time..
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;
}

Casper001
04/04/2012, 06:37 PM
Thanks, Help still appreciated

aRoach
04/04/2012, 06:42 PM
Thanks, Help still appreciated

You're welcome, is for this reason that we are here ;)

Casper001
04/04/2012, 08:21 PM
Sorry, bump. Any help? The start of the CMD Is line 41220 Just if you need that

TzAkS.
04/04/2012, 08:46 PM
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;
}

Casper001
04/04/2012, 09:11 PM
No, Sorry that dont work :( I get 6 errors from Scripting

TzAkS.
04/04/2012, 09:14 PM
Can u give me the line with errors?

Casper001
04/04/2012, 09:21 PM
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

TzAkS.
04/04/2012, 09:27 PM
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];