dcmd_medic(playerid, params[])
{
#pragma unused params
if(gTeam[playerid] == TEAM_MEDIC) return SendClientMessage(playerid, COLOR_ERROR, "You is an medic, You dont need to reques other medics, try /commands instead");
else if(HasRequestedMedic[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR, "You have already requested an medic, please sit down and wait");
else
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(gTeam[i] == TEAM_MEDIC)
{
new playername[MAX_PLAYER_NAME], string[128];
GetPlayerName(i, playername, sizeof(playername));
format(string, sizeof(string), "%s(%d) has requested medic in %s", playername, playerid, GetPlayerZone(playerid));
SendClientMessage(i, COLOR_GREEN, string);
printf("%s", string);
SendClientMessage(i, COLOR_GREEN, "You have requested an medic");
HasRequestedMedic[playerid] = 1;
return 1;
}
}
return 1;
}
}
dcmd_food(playerid, params[])
{
#pragma unused params
if(gTeam[playerid] == TEAM_BISTRO) return SendClientMessage(playerid, COLOR_ERROR, "You is an bistro, You cant call for other bistros");
else if(HasRequestedBistro[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR, "You have already requested an bistro, please sit down and wait");
else
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(gTeam[i] == TEAM_BISTRO)
{
new playername[MAX_PLAYER_NAME], string[128];
GetPlayerName(i, playername, sizeof(playername));
format(string, sizeof(string), "%s(%d) has requested food in %s", playername, playerid, GetPlayerZone(playerid));
SendClientMessage(i, COLOR_GREEN, string);
printf("%s", string);
SendClientMessage(i, COLOR_GREEN, "You have requested an food");
HasRequestedBistro[playerid] = 1;
return 1;
}
}
return 1;
}
}
Dude, spelling mistakes:
You is an medic, You dont need to reques other medics, try /commands instead ==> You are a medic, you don't need to request other medics, try /commands instead. You have already requested an medic, please sit down and wait ==> You have already requested a medic, please sit down and wait. You have requested an food ==> You have requested some food. |
You will not get an error by removing that
and what i think it happening is when its found the first if(gTeam[i] == TEAM_MEDIC) its not looking again because of the return. so if you just try it. Thanks |
C:\Users\Unknown\Documents\MyServer\gamemodes\Unknown.pwn(2756) : warning 209: function "dcmd_food" should return a value
Hey buddy, hows about you tell us what exactly is WRONG with the command? Does it return any SendClientMessage's ? How about you put some print's in the code and figure out the problem.
|