function returning value help +rep
#1

Hi I guys I made this stock function.....

pawn Код:
stock SendAdminMessage(color,text[])
{
    new File:file = fopen(Logs_AdmCmd,io_append),String[512],hour,mins,secs,year,month,day;
    gettime(hour,mins,secs);
    getdate(year,month,day);
    format(String,sizeof(String),"[%d/%d/%d][%d:%d:%d] %s \n",day,month,year,hour,mins,secs,text);
    fwrite(file,String);
    fclose(file);
    printf(String);
    foreach(Player,i)
    {
        if(GetP_VarInt(i,p_Adminlevel) > 0)
        {
            SendClientMessage(i,color,text);
        }
    }
}
And a command in which am using it:
pawn Код:
CMD:deleteplayervehicle(playerid,params[])
{
    new str[128],vehid;
    if(GetP_VarInt(playerid,p_Adminlevel) > 4)
    {
        if(IsPlayerInPlayersVehicle(playerid))
        {
            vehid = GetPlayerVehicleID(playerid);
            DestroyVehicle(vehid);
            format(str,sizeof(str),"AdminCMD: Admin %s have deleted a player vehicle(%s).",GetPlayerNameEx(playerid),GetVehicleName(vehid));
            SendAdminMessage(C_DARKRED2,str);
        }
    }
    return 1;
}
But The problem is this function is not working and server show "server unknown command."

If I used Like this it works :
pawn Код:
format(str,sizeof(str),"AdminCMD: Admin %s have deleted a player vehicle(%s).",GetPlayerNameEx(playerid),GetVehicleName(vehid));
            SendAdminMessage(C_DARKRED2,str);
DestroyVehicle(vehid);
and also works if i'll remove
pawn Код:
DestroyVehicle(vehid);
Reply


Messages In This Thread
function returning value help +rep - by Shabi RoxX - 10.03.2012, 16:02
Re: function returning value help +rep - by Shabi RoxX - 10.03.2012, 16:41
Re: function returning value help +rep - by Twisted_Insane - 10.03.2012, 17:18
Re: function returning value help +rep - by Shabi RoxX - 10.03.2012, 17:58
Re: function returning value help +rep - by Konstantinos - 10.03.2012, 18:10
Re: function returning value help +rep - by Shabi RoxX - 10.03.2012, 18:18
Re: function returning value help +rep - by Konstantinos - 10.03.2012, 18:23
Re: function returning value help +rep - by Shabi RoxX - 10.03.2012, 18:24

Forum Jump:


Users browsing this thread: 2 Guest(s)