CMD retrun problem -
N0FeaR - 07.06.2012
I have a end of the cmd
warning 209: function "cmd_equip" should return a value
pawn Код:
}
COMMAND:givehealthinsurance(playerid, params[])
{
if(Died[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead."); return 1; }
if(isnull(params)) return SendClientMessage(playerid, COLOUR_SYSTEM, "USAGE: /givehealthinsurance [playerid/partofname]");
if(PlayerInfo[playerid][pFaction] == 2)
{
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID) { SendClientMessage(playerid, COLOR_WHITE, "Playerid is not an active playerid."); return 1; }
{
PlayerInfo[giveplayerid][pLifeLic] = 1;
new give1[128];
format(give1, sizeof(give1), "You have given %s a medical insurance.", GetPlayerNameEx(giveplayerid));
SendClientMessage(playerid, COLOR_WHITE, give1);
format(give1, sizeof(give1), "%s gave you a medical insurance.", GetPlayerNameEx(giveplayerid));
SendClientMessage(giveplayerid, COLOR_WHITE, give1);
}
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not in EMT.");
}
return 1;
}
Re: CMD retrun problem -
Revo - 07.06.2012
You're showing COMMAND:GIVEHEALTHINSURANCE, not COMMAND:equip
Also, the exact line and error helps.
Re: CMD retrun problem -
zDevon - 07.06.2012
Have you posted the correct command? The name from the warning says cmd_equip.
Re: CMD retrun problem -
N0FeaR - 07.06.2012
Sorry for wrong cmd
Код:
}
COMMAND:equip(playerid, params[])
{
if(Died[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead."); return 1; }
if(PlayerInfo[playerid][pFaction] == 1) // LSPD
{
if(PlayerToPoint(2.5,playerid,233.4385,122.4045,1003.2188))
{
ShowPlayerDialog(playerid, 112, DIALOG_STYLE_LIST, "Equipment Locker", "Night Stick\nPepper Spray\nDesert Eagle\nMP5\nKnife\nShotgun\nM4A1\nSniper Rifle\nCamera\nParachute\nKevlar & Helmet\n Put equipment back", "Equip", "Cancel");
return 1;
}
else if(PlayerInfo[playerid][pFaction] == 2) // EMS
{
if(PlayerToPoint(2.5,playerid,MedicDutyPosition[X],MedicDutyPosition[Y],MedicDutyPosition[Z]))
{
ShowPlayerDialog(playerid, 113, DIALOG_STYLE_LIST, "Equipment Locker", "Fire Extinguisher\nShovel", "Equip", "Cancel");
return 1;
}
}
else if(PlayerInfo[playerid][pFaction] == 0) // Sheriff
{
if(PlayerToPoint(2.5,playerid,PoliceDutyPosition[X],PoliceDutyPosition[Y],PoliceDutyPosition[Z]))
{
ShowPlayerDialog(playerid, 112, DIALOG_STYLE_LIST, "Equipment Locker", "Night Stick\nPepper Spray\nDesert Eagle\nMP5\nKnife\nShotgun\nM4A1\nSniper Rifle\nCamera\nParachute\n Put equipment back", "Equip", "Cancel");
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not at the docks.");
}
return 1;
Re: CMD retrun problem -
Sandiel - 07.06.2012
You don't have a bracket to end the COMMAND, do you?
Re: CMD retrun problem -
zDevon - 07.06.2012
Give this a go:
pawn Код:
COMMAND:equip(playerid, params[])
{
if(Died[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead.");
}
else
{
if(PlayerInfo[playerid][pFaction] == 1) // LSPD
{
if(PlayerToPoint(2.5,playerid,233.4385,122.4045,1003.2188))
{
ShowPlayerDialog(playerid, 112, DIALOG_STYLE_LIST, "Equipment Locker", "Night Stick\nPepper Spray\nDesert Eagle\nMP5\nKnife\nShotgun\nM4A1\nSniper Rifle\nCamera\nParachute\nKevlar & Helmet\n Put equipment back", "Equip", "Cancel");
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not at the docks.");
}
}
else if(PlayerInfo[playerid][pFaction] == 2) // EMS
{
if(PlayerToPoint(2.5,playerid,MedicDutyPosition[X],MedicDutyPosition[Y],MedicDutyPosition[Z]))
{
ShowPlayerDialog(playerid, 113, DIALOG_STYLE_LIST, "Equipment Locker", "Fire Extinguisher\nShovel", "Equip", "Cancel");
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not at the docks.");
}
}
else if(PlayerInfo[playerid][pFaction] == 0) // Sheriff
{
if(PlayerToPoint(2.5,playerid,PoliceDutyPosition[X],PoliceDutyPosition[Y],PoliceDutyPosition[Z]))
{
ShowPlayerDialog(playerid, 112, DIALOG_STYLE_LIST, "Equipment Locker", "Night Stick\nPepper Spray\nDesert Eagle\nMP5\nKnife\nShotgun\nM4A1\nSniper Rifle\nCamera\nParachute\n Put equipment back", "Equip", "Cancel");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not at the docks.");
}
}
}
return 1;
}