Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] Help with command

 
  • 0 Vote(s) - 0 Average
Pawn Help with command
Pedxz
Offline

Burgershot Member
Posts: 5
Threads: 3
Joined: Jun 2021
Reputation: 0
Location: Brasil
#1
2021-07-05, 05:31 PM (This post was last modified: 2021-07-05, 05:32 PM by Pedxz.)
Welll, I update my command's permission to !IsPlayerAdmin, but now it doesn't want to work correctly, when i run the command it doesn't do anything.

***I changed the permission because the other one was having problems

Could you help me solve this??


Command:
Code:
CMD:setar(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Você não tem permissão!");

new id, sSetar[15];

if(sscanf(params, "ds[15]", id, sSetar)) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Uso correto: /Setar [ ID ] [ Administrador / Moderador / Ajudante ]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Ninguém online com esse ID!");

if(!strcmp(sSetar, "administrador", true))
{
if(GetPlayerCargo(id) != C_ADMIN)
{
format(gStr, sizeof(gStr), "[BPL Staff] Você tornou o(a) jogador(a) %s um(a) administrador(a).", pNome(id));
SendClientMessage(playerid, COLOR_VERDECMD, gStr);

format(gStr, sizeof(gStr), "[BPL Staff] %s tornou você um(a) administrador(a).", GetCargoMsg(playerid));
SendClientMessage(id, COLOR_VERDECMD, gStr);

SetPVarInt(id, "pCargo", C_ADMIN), aInfo[id][Cargo] = C_ADMIN;
}
else
{
format(gStr, sizeof(gStr), "[BPL Staff] Você removeu os privilégios de administrador(a) do(a) jogador(a) %s", pNome(id));
SendClientMessage(playerid, COLOR_VERDECMD, gStr);

format(gStr, sizeof(gStr), "[BPL Staff] %s removeu seus privilégios de administrador(a).", GetCargoMsg(playerid));
SendClientMessage(id, COLOR_VERDECMD, gStr);

SetPVarInt(id, "pCargo", C_JOGADOR), aInfo[id][Cargo] = C_JOGADOR;
}
}
else if(!strcmp(sSetar, "moderador", true))
{
if(GetPlayerCargo(playerid) != C_MODERADOR)
{
format(gStr, sizeof(gStr), "[BPL Staff] Você tornou o(a) jogador(a) %s um(a) moderador(a).", pNome(id));
SendClientMessage(playerid, COLOR_VERDECMD, gStr);

format(gStr, sizeof(gStr), "[BPL Staff] %s tornou você um(a) moderador(a).", GetCargoMsg(playerid));
SendClientMessage(id, COLOR_VERDECMD, gStr);

SetPVarInt(id, "pCargo", C_MODERADOR), aInfo[id][Cargo] = C_MODERADOR;
}
else
{
format(gStr, sizeof(gStr), "[BPL Staff] Você removeu os privilégios de moderador(a) do(a) jogador(a) %s", pNome(id));
SendClientMessage(playerid, COLOR_VERDECMD, gStr);

format(gStr, sizeof(gStr), "[BPL Staff] %s removeu seus privilégios de moderador(a).", GetCargoMsg(playerid));
SendClientMessage(id, COLOR_VERDECMD, gStr);

SetPVarInt(id, "pCargo", C_JOGADOR), aInfo[id][Cargo] = C_JOGADOR;
}
}
else if(!strcmp(sSetar, "ajudante", true))
{
if(GetPlayerCargo(playerid) != C_AJUDANTE)
{
format(gStr, sizeof(gStr), "[BPL Staff] Você tornou o(a) jogador(a) %s um(a) ajudante.", pNome(id));
SendClientMessage(playerid, COLOR_VERDECMD, gStr);

format(gStr, sizeof(gStr), "[BPL Staff] %s tornou você um(a) ajudante.", GetCargoMsg(playerid));
SendClientMessage(id, COLOR_VERDECMD, gStr);

SetPVarInt(id, "pCargo", C_AJUDANTE), aInfo[id][Cargo] = C_AJUDANTE;
}
else
{
format(gStr, sizeof(gStr), "[BPL Staff] Você removeu os privilégios de ajudante do(a) jogador(a) %s", pNome(id));
SendClientMessage(playerid, COLOR_VERDECMD, gStr);

format(gStr, sizeof(gStr), "[BPL Staff] %s removeu seus privilégios de ajudante.", GetCargoMsg(playerid));
SendClientMessage(id, COLOR_VERDECMD, gStr);

SetPVarInt(id, "pCargo", C_JOGADOR), aInfo[id][Cargo] = C_JOGADOR;
}
}
return 1;
}
[img] https://i.servimg.com/u/f69/19/84/40/33/assina10.png [/ img]
Radical
Offline

Burgershot Member
Posts: 148
Threads: 21
Joined: Dec 2020
Reputation: 16
#2
2021-07-06, 01:33 AM (This post was last modified: 2021-07-06, 01:36 AM by Radical.)
IsPlayerAdmin() is for RCON admin. (/rcon)
Not your custom admin system.

So, you have to logged-in to RCON and then you can use this command.
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode