12.08.2013, 00:10
[SOLVED]
CMD:news(playerid, params[])
{
if(PlayerInfo[playerid][pFaction] != NEWS)
{
SCM(playerid, COLOR_LIGHTRED,"Invalid faction");
}
new string[128];
if(shutdown == 1)
{
SCM(playerid, COLOR_WHITE, "The news system is currently shut down.");
}
if(!isAdminDuty(playerid))
{
SCM(playerid,COLOR_WHITE, "You can't use this command while on-duty as admin.");
}
if(isnull(params))
{
SCM(playerid, COLOR_WHITE, "USAGE: /news [text]");
}
new vehicleid = GetPlayerVehicleID(playerid);
if(IsACopCar(vehicleid))
{
if(PlayerInfo[playerid][pRank] < 1)
{
SCM(playerid, COLOR_GRAD2, "You must be at least rank 1.");
}
else
{
format(string, sizeof(string), "News Radio %s: %s", GetPlayerNameEx(playerid), params);
ICNews(COLOR_LIGHTGREEN,string);
}
else
{
SCM(playerid, COLOR_GREY, "You're not in a news van or a news chopper.");
}
return 1;//You need to return a value here because there are if statements here
}
else
{
SCM(playerid, COLOR_GREY, "You are not a News Reporter!");
}
return 1; //we need to return a value here aswell for the if statements on this line too
}