29.07.2012, 08:37
So I want a tempban cmd for my server. /tempban <playerid> <days> <reason>
Could someone help me?
Really need it
I'm not so pro so i can make it by myself 
The time:Here
Could someone help me?
Really need it
I'm not so pro so i can make it by myself 
Код:
forward LoadPlayerData(playerid, name[], value[]);
enum pData
{
pPassword,
pAdmin,
pMoney,
pScore,
pMute,
pFrozen,
pSpecating,
pSkin,
pWarn,
pSpam,
pDuty,
VIP,
pBan,
}
new P_Data[MAX_PLAYERS][pData];
public LoadPlayerData(playerid, name[], value[])
{
INI_Int("Password", P_Data[playerid][pPassword]);
INI_Int("Admin", P_Data[playerid][pAdmin]);
INI_Int("Money", P_Data[playerid][pMoney]);
INI_Int("Score", P_Data[playerid][pScore]);
INI_Int("Skin", P_Data[playerid][pSkin]);
INI_Int("Warn", P_Data[playerid][pWarn]);
INI_Int("VIP", P_Data[playerid][VIP]);
return 1;
}
stock GetName(playerid)
{
new
pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
return pName;
}
if(P_Data[playerid][pAdmin] < 1) return SCM(playerid, COLOR_RED, "You aren't an admin!");
//On my makeadmin command am i using this: (I want someting similiar to this but /tempban instead if you know that i mean... and the time: 1 day (24 hours) is 60 * 60 * 24 = 86400
YCMD:setadmin(playerid, params[], help)
{
#pragma unused help
if(P_Data[playerid][pAdmin] < 5 && !IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_RED, "You need to be admin level 4/RCON to use this!");
new
string[128],pplayerid,level,pFile[35];
format(pFile, 35, Player_File, GetName(pplayerid));
if(sscanf(params, "ui", pplayerid,level)) return SCM(playerid, COLOR_RED, "Usage: /setadmin [Player ID/Player Name] [Admin Level]");
if(level > 5 || level <= 0) return SCM(playerid,COLOR_RED,"Max level is 5");
if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"has given you admin level"COL_WHITE" %d",GetName(playerid),level);
SCM(pplayerid,-1,string);
format(string,sizeof(string),""COL_RED"Player "COL_WHITE"%s "COL_RED"now have admin level"COL_WHITE" %d",GetName(pplayerid),level);
SCM(playerid,-1,string);
new
INI:UserFile = INI_Open(pFile);
INI_WriteInt(UserFile, "Admin", P_Data[pplayerid][pAdmin]);
P_Data[pplayerid][pAdmin] = level;
INI_Close(UserFile);
return 1;
}


But if I get any problems so will I contact you via pm!