10.03.2012, 16:02
Hi I guys I made this stock function.....
And a command in which am using it:
But The problem is this function is not working and server show "server unknown command."
If I used Like this it works :
and also works if i'll remove
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);
}
}
}
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;
}
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);
pawn Код:
DestroyVehicle(vehid);