how make helper for my roleplay gamemode
#1

Hello all,
I need help for make helper rank at roleplay server.

sorry for my bad english
Reply
#2

Degree? If you mean command that would be like this based on ZCMD
pawn Код:
CMD:makehelper(playerid, params[])
{
  new playerb;
  if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /makehelper [playerid]");
 Helper[playerb] = 1;
 return 1;
}
Define pHelper in the enum of playerinfo or whatever it is in ur server.
Reply
#3

sorry for use degree word,
I mean rank
Reply
#4

Here's a Logic code.
At the top of your script add.
pawn Код:
enum pInfo
{
    pHelper
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Then.
pawn Код:
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;
}
Then, Under OnPlayerDisconnect
pawn Код:
new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pHelper]);
    INI_Close(File);
EDIT: Added rank and a little elaboration.
Reply
#5

now help me for how make cmd /helpme [HelpText],
for example:/helpme how buy car
and when player type that ,how buy car send to all helpers.
Reply
#6

pawn Код:
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;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)