15.06.2014, 13:44
Hello all,
I need help for make helper rank at roleplay server.
sorry for my bad english
I need help for make helper rank at roleplay server.
sorry for my bad english
CMD:makehelper(playerid, params[])
{
new playerb;
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /makehelper [playerid]");
Helper[playerb] = 1;
return 1;
}
enum pInfo
{
pHelper
}
new PlayerInfo[MAX_PLAYERS][pInfo];
CMD:makehelper(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
new id,rank;
if(sscanf(params,"ii",id,rank))
{
SendClientMessage(playerid,-1,"USAGE: /makehelper [playerid] [rank]");
return 1;
}
else
{
if(IsPlayerConnected(i))
{
PlayerInfo[id][pHelper]=rank; //Rank according to you.
}
else
{
SendClientMessage(playerid,-1,"Player is not Online");
return 1;
}
}
}
else
{
SendClientMessage(playerid,-1,"You are not an Admin");
return 1;
}
return 1;
}
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pHelper]);
INI_Close(File);
CMD:helpme(playerid,params[])
{
new str[128];
if(sscanf(params,"s[128]",str)
{
SendClientMessage(playerid,-1,"/helpme [text/question]");
return 1;
}
else
{
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pHelper] >=5) //Level/Rank according to you.
{
SendClientMessage(i,-1,str);
}
}
}
}
return 1;
}