03.09.2012, 15:02
I get these errors;
1426 is meant to check & see if there's any medics on medic duty (mDuty = 1), as that's our medic-duty function, and if not, hospitalize the player.
Here's the mDuty stuff;
Quote:
C:\Users\owner\Desktop\SCRP\Server Files\gamemodes\SCRP0.2.1.pwn(140 : warning 235: public function lacks forward declaration (symbol "OnPlayerNeedMedic") C:\Users\owner\Desktop\SCRP\Server Files\gamemodes\SCRP0.2.1.pwn(1426) : error 029: invalid expression, assumed zero C:\Users\owner\Desktop\SCRP\Server Files\gamemodes\SCRP0.2.1.pwn(1426) : warning 215: expression has no effect C:\Users\owner\Desktop\SCRP\Server Files\gamemodes\SCRP0.2.1.pwn(1426) : error 001: expected token: ";", but found "if" C:\Users\owner\Desktop\SCRP\Server Files\gamemodes\SCRP0.2.1.pwn(1426) : error 033: array must be indexed (variable "mDuty") |
pawn Код:
new NeedMedic[MAX_PLAYERS];
public OnPlayerConnect(playerid);
{
NeedMedic[playerid] = 0;
};
public OnPlayerNeedMedic(playerid) // line 1408
{
new string[512];
if(Player[playerid][Health] <= 30)
NeedMedic[playerid] = 1;
format(string, sizeof(string), "You have been seriously injured, %s. A by-stander has called 911, medical help is coming.", GetPlayerFirstName(playerid));
SendClientMessage(playerid, RED, string);
format(string, sizeof(string), "<DISPATCH 803.71MHz> There has been reports of a civilian in need of urgent medical assistance!");
SendFactionMessage(1, RADIOCHAT, string);
SendFactionMessage(2, RADIOCHAT, string);
format(string, sizeof(string), "<DISPATCH 803.71MHz> The location has been automatically updated on your MDC, units please respond.");
SendFactionMessage(1, RADIOCHAT, string);
SendFactionMessage(2, RADIOCHAT, string);
TogglePlayerControllable(playerid, false);
ApplyAnimation(playerid,"CRACK","crckdeth2",4.1,1,1,1,1,1);
SetTimerEx("Injured", 120000, 0, "d", playerid);
SendClientMessage(playerid, LIBLUE, "(( You are frozen for two minutes, to allow medics to get here. ))");
{
else if(mDuty < 1) // // line 1426
Hospitalized[playerid] = 1;
}
return 1
}
1426 is meant to check & see if there's any medics on medic duty (mDuty = 1), as that's our medic-duty function, and if not, hospitalize the player.
Here's the mDuty stuff;
pawn Код:
new mDuty[MAX_PLAYERS];
public OnPlayerConnect(playerid);
{
mDuty[playerid] = 0;
};
// Here's the mDuty stuff from the /duty command;
if(mDuty[playerid] == 0)
{
format(string, sizeof(string), "Paramedic Message: %s %s is now on duty.", GetRankName(playerid), RemoveUnderScore(playerid));
FactionMessage(playerid, BLUE, string);
mDuty[playerid] = 1;
}