killdahobo99
Unregistered
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.