04.02.2009, 18:42
i moved everything to the last part of the code and now it says:
error 030: compound statement not closed at the end of file (started at line 3687)
3687:
The beginning:
ETC ETC.
error 030: compound statement not closed at the end of file (started at line 3687)
3687:
Код:
new string[256];
Код:
public OnPlayerCommandsText(playerid, cmdtext[])
{
new string[256];
new cmd[256];
new giveplayerid, idx;
new tmp[256];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/heal", true) == 0) {
if(IsSpawned[playerid] == 0) {
SendClientMessage(playerid, COLOR_ERROR, "You are dead. You cannot use this command");
return 1;
}
if(Jailed[playerid] == 1) {
SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command in jail");
return 1;
}
if(gTeam[playerid] != TEAM_MEDIC) {
SendClientMessage(playerid,COLOR_ERROR,"You are not a medic");
return 1;
}
if(InDerby[playerid] == 1) {
SendClientMessage(playerid,COLOR_ERROR,"You cannot use this command while you are in the stadium");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /heal (id)");
return 1;
}
giveplayerid = strval(tmp);
if(!IsNumeric(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /heal (id) ID Must be a number");
return 1;
}
new mname[24];
new pname[24];
GetPlayerName(playerid,mname, 24);
GetPlayerName(giveplayerid, pname, 24);
if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 5) {
format(string, sizeof(string), "%s(%d) Is not close enough. You cannot heal that player",pname,giveplayerid);
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}
if(wantsheal[giveplayerid] == 0) {
format(string, sizeof(string), "Medic %s(%d) has attempted to heal you. Type /medic if you need a Medic",mname,playerid);
SendClientMessage(giveplayerid,COLOR_FORESTGREEN, string);
format(string, sizeof(string), "%s(%d) has not asked for a medic. You cannot heal that player", pname,giveplayerid);
SendClientMessage(playerid,COLOR_ERROR, string);
}
else
if(wantsheal[giveplayerid] == 1) {
new mrand = random(3500);
oscore = GetPlayerScore(playerid);
SendClientMessage(giveplayerid,0xA9A9A9AA, "|_Health Restored_|");
format(string, sizeof(string), "Medic %s(%d) has healed you for $%d",mname,playerid,mrand);
SendClientMessage(giveplayerid,COLOR_FORESTGREEN, string);
SendClientMessage(playerid,0xA9A9A9AA, "|_Player Health Restored_|");
format(string, sizeof(string), "%s(%d) has been healed. You earned $%d", pname,giveplayerid,mrand);
SendClientMessage(playerid,COLOR_FORESTGREEN, string);
SetPlayerHealth(giveplayerid,100);
GivePlayerMoney(giveplayerid,-mrand);
GivePlayerMoney(playerid,mrand);
SetPlayerScore(playerid, oscore +1);
wantsheal[giveplayerid] =0;
}
return 1;
}

