How to make army rights
#5

Quote:
Originally Posted by [TPG
Coole210 ]
Try this, instead of 0 Put GetPlayerRights [function below]
and an easy command (/giverights)

pawn Код:
// BOTTOM OF SCRIPT
stock GetPlayerRights(playerid)
{
    return CanUseArmy[playerid];
}
pawn Код:
//OnPlayerCommandText
if(strcmp(cmd,"/giverights",true) == 0) if(IsPlayerAdmin(playerid))
{
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,COLOR,"USAGE: /giverights [playerid]");
    new giveplayerid = strval(tmp);
    new giveplayer[MAX_PLAYER_NAME];
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));
    GetPlayerName(playerid,sendername,sizeof(sendername));
    new string[128];
    format(string,sizeof(string),"[ ! ] You can now choose the army skin thanks to administrator %s",sendername);
    SendClientMessage(giveplayerid,COLOR,string);
    format(string,sizeof(string),"[ ! ] You have given %s rights to wear army skin",giveplayer);
    SendClientMessage(playerid,COLOR,string);
    CanUseArmy[giveplayerid] = 1;
    return 1;
}
if(strcmp(cmd,"/removerights",true) == 0) if(IsPlayerAdmin(playerid))
{
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp)) return SendClientMessage(playerid,COLOR,"USAGE: /removerights [playerid]");
    new giveplayerid = strval(tmp);
    new giveplayer[MAX_PLAYER_NAME];
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));
    GetPlayerName(playerid,sendername,sizeof(sendername));
    new string[128];
    format(string,sizeof(string),"[ ! ] Your rights for army has been reset by %s !",sendername);
    SendClientMessage(giveplayerid,COLOR,string);
    format(string,sizeof(string),"[ ! ] You have removed %s rights to wear army skin",giveplayer);
    SendClientMessage(playerid,COLOR,string);
    SendClientMessage(giveplayerid,COLOR,"[ ! ] You are kicked !");
    Kick(giveplayerid);
    CanUseArmy[giveplayerid] = 0;
    return 1;
}

This is great! but the problem is i need to make it so it reads from the players .dudb file. I already have a login/register system (i posted up there) I need to make it so it reads from the file and if it's 0 in the file then they cant play.

These commands work and all, but when the server restarts, the player is not army any more.
Reply


Messages In This Thread
How to make army rights - by killdahobo99 - 19.08.2009, 00:58
Re: How to make army rights - by snoob - 19.08.2009, 01:39
Re: How to make army rights - by coole210 - 19.08.2009, 03:24
Re: How to make army rights - by Calgon - 19.08.2009, 04:14
Re: How to make army rights - by killdahobo99 - 19.08.2009, 13:42
Re: How to make army rights - by coole210 - 19.08.2009, 18:23
Re: How to make army rights - by Hoss - 17.10.2010, 12:38
Re: How to make army rights - by CrucixTM - 17.10.2010, 12:46

Forum Jump:


Users browsing this thread: 1 Guest(s)