Set Player To Use FilterScript
#1

I am using an Edit of Breadfish's object editor /https://sampforum.blast.hk/showthread.php?tid=79035/ and i want to be able to; as an admin ( no admin FS, im sticking with RCON as nothing more it needed) to do /makemapper [id] . i have tried with other script bits, that do the same function like /makecop. I would add the command along with admin FS, but i do not want to use one.

SO, what i need is a small thing; so that i can set people to use the object editor because it is currently IsPlayerAdmin, and i do not feel good with giving people my RCON password :P

Anything Would Be Appreciated! THANKS
Reply
#2

I suppose that you could try the following.

Create a global variable "
Код:
new tempmapper[MAX_PLAYERS];
"

Then create a command to set the variable on the player from 0 to 1.

(Dcmd as default)
Код:
dcmd_makemapper(playerid,params[])
{
if(IsPlayerAdmin,playerid)
if(!strlen(params)) {
SendClientMessage(playerid,color,"Usage: /makemapper [player]");
return 1;
}
tempmapper[params] 1;
return 1;
}
Then on the command to start object editing just check if the player is a temporary mapper.


(Code might be dodgy)
Reply
#3

Thanks ill try it out!
Reply
#4

Quote:
Originally Posted by (S)Toril
Посмотреть сообщение
I suppose that you could try the following.

Create a global variable "
Код:
new tempmapper[MAX_PLAYERS];
"

Then create a command to set the variable on the player from 0 to 1.

(Dcmd as default)
Код:
dcmd_makemapper(playerid,params[])
{
if(IsPlayerAdmin,playerid)
if(!strlen(params)) {
SendClientMessage(playerid,color,"Usage: /makemapper [player]");
return 1;
}
tempmapper[params] 1;
return 1;
}
Then on the command to start object editing just check if the player is a temporary mapper.


(Code might be dodgy)
So, this is a temp only, so it has to be set everytime they log on? - how would i edit it so that the names are saved?
Reply
#5

Give this a try, should work...

pawn Код:
//Top of Script
new mfile[90];

dcmd_makemapper(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, color, "You are not an RCON admin!");
    if(!strlen(params)) return SendClientMessage(playerid, color, "Usage: /makemapper [player]");

    new Target = strval(params);
    if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid, color, "Player not found.");

    new pName[MAX_PLAYER_NAME];
    GetPlayerName(Target, pName, sizeof(pName));

    format(mfile, sizeof(mfile), "mappers.ini");
    if(!dini_Exists(mfile)) dini_Create(mfile);
    dini_IntSet(mfile, pName, 1);
    return 1;
}

stock IsPlayerAMapper(playerid)
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));

    format(mfile, sizeof(mfile), "mappers.ini");
    if(dini_Int(mfile, pName) == 1) return 1;
    return 0;
}

//Under mapping commands add this
if(!IsPlayerAMapper(playerid)) return SendClientMessage(playerid, color, "You are not a mapper!");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)