Need help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help (
/showthread.php?tid=489263)
Need help -
ultrAslan - 21.01.2014
Hi i have found a announce FS but before i can use it i must logging in as rcon admin but how i can change it ?
i want that lv3 admins and higher can use it without rcon login .
Код:
//Includes
#include <a_samp>
#include <zcmd>
#include <sscanf2>
//Defines
#define COLOR_GREEN 0x33AA33AA
//Command
CMD:announce(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid, COLOR_GREEN, "You are not allowed to use this command!");
new text[64], time, style;
if (sscanf(params, "iis[64]", style, time, text)) return
SendClientMessage(playerid, COLOR_GREEN, "Usage: /announce <style[0-6]> <time in ms> <text>");
if (strlen(text) > 64) return
SendClientMessage(playerid, COLOR_GREEN, "Message too long please shorten it!");
if(style == 2) return SendClientMessage(playerid, COLOR_GREEN, "Bug with style 2 don't use it!");
if (style < 0 || style > 6) return
SendClientMessage(playerid, COLOR_GREEN,"Invalid style!");
if (time > 20*1000) return
SendClientMessage(playerid, COLOR_GREEN, "No longer than 20 seconds!");
GameTextForAll(text, time, style);
return 1;
}
Re: Need help -
Nourdin - 21.01.2014
What is the variable of your Admin Status?
Re: Need help -
TLN - 21.01.2014
pawn Код:
//Includes
#include <a_samp>
#include <zcmd>
#include <sscanf2>
//Defines
#define COLOR_GREEN 0x33AA33AA
//Command
CMD:announce(playerid, params[])
{
if(APlayerData[playerid][PlayerLevel] >= 3)
return SendClientMessage(playerid, COLOR_GREEN, "You are not allowed to use this command!");
new text[64], time, style;
if (sscanf(params, "iis[64]", style, time, text)) return
SendClientMessage(playerid, COLOR_GREEN, "Usage: /announce <style[0-6]> <time in ms> <text>");
if (strlen(text) > 64) return
SendClientMessage(playerid, COLOR_GREEN, "Message too long please shorten it!");
if(style == 2) return SendClientMessage(playerid, COLOR_GREEN, "Bug with style 2 don't use it!");
if (style < 0 || style > 6) return
SendClientMessage(playerid, COLOR_GREEN,"Invalid style!");
if (time > 20*1000) return
SendClientMessage(playerid, COLOR_GREEN, "No longer than 20 seconds!");
GameTextForAll(text, time, style);
return 1;
}
Re: Need help -
Stinged - 21.01.2014
You need to have your own admin system.
Then use the thing you used for admin levels. Ex: pInfo[playerid][admin]
Replace if(!IsPlayerAdmin(playerid)) with if(!pInfo[playerid][admin] >= 3)