how make helper for my roleplay gamemode
#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


Messages In This Thread
how make helper for my roleplay gamemode - by kinggta - 15.06.2014, 13:44
Re: how make helper for my roleplay gamemode - by Laure - 15.06.2014, 13:46
Re: how make helper for my roleplay gamemode - by kinggta - 15.06.2014, 13:49
Re: how make helper for my roleplay gamemode - by Rittik - 15.06.2014, 13:55
Re: how make helper for my roleplay gamemode - by kinggta - 15.06.2014, 14:02
Re: how make helper for my roleplay gamemode - by Rittik - 15.06.2014, 14:08

Forum Jump:


Users browsing this thread: 1 Guest(s)