if (strcmp("/News", cmdtext, true, 5) == 0)
{
new file[128];
format(file, sizeof(file), "News.ini");
if(IsPlayerAdmin(playerid)){
new string[256];
strmid(string, cmdtext, 6, 256);
dini_Set(file, "News", string);
new thing[256];
thing = dini_Get(file, "News");
format(string, sizeof(string), "Server News: %s", thing);
SendClientMessage(playerid, GREEN, string);
}
else
{
SendClientMessage(playerid, GREEN, "You have to be logged into RCON in order to change the News!");
}
return 1;
}
return 0;
}
#include <zcmd>//include it first.
CMD:news(playerid,params[])
{
new file[128];
format(file, sizeof(file), "News.ini");
if(IsPlayerAdmin(playerid)){
new string[256];
strmid(string, cmdtext, 6, 256);
dini_Set(file, "News", string);
new thing[256];
thing = dini_Get(file, "News");
format(string, sizeof(string), "Server News: %s", thing);
SendClientMessage(playerid, GREEN, string);
}
else
{
SendClientMessage(playerid, GREEN, "You have to be logged into RCON in order to change the News!");
}
return 1;
}
CMD:News(playerid, params[])
{
new file[128];
format(file, sizeof(file), "News.ini");
if(IsPlayerAdmin(playerid)){
new string[256];
strmid(string, params, 6, 256);
dini_Set(file, "News", string);
new thing[256];
thing = dini_Get(file, "News");
format(string, sizeof(string), "Server News: %s", thing);
SendClientMessage(playerid, 0x006400FF, string);
}
else
{
SendClientMessage(playerid, 0x006400FF, "You have to be logged into RCON in order to change the News!");
}
return 1;
}
pawn Код:
|
CMD:news(playerid, params[])
{
new file[128];
format(file, sizeof(file), "News.ini");
if(IsPlayerAdmin(playerid)){
new string[256];
strmid(string, params, 6, 256);
dini_Set(file, "News", string);
new thing[256];
thing = dini_Get(file, "News");
format(string, sizeof(string), "Server News: %s", thing);
SendClientMessage(playerid, 0x006400FF, string);
}
else
{
SendClientMessage(playerid, 0x006400FF, "You have to be logged into RCON in order to change the News!");
}
return 1;
}
CMD:news(playerid, params[]) { new file[128]; format(file, sizeof(file), "News.ini"); if(IsPlayerAdmin(playerid)){ new string[256]; strmid(string, params, 6, 256); dini_Set(file, "News", string); new thing[256]; thing = dini_Get(file, "News"); format(string, sizeof(string), "Server News: %s", thing); SendClientMessage(playerid, 0x006400FF, string); } else { SendClientMessage(playerid, 0x006400FF, "You have to be logged into RCON in order to change the News!"); } return 1; }
Код:
CMD:news(playerid, params[]) { new file[128]; format(file, sizeof(file), "News.ini"); if(IsPlayerAdmin(playerid)){ new string[256]; strmid(string, params, 6, 256); dini_Set(file, "News", string); new thing[256]; thing = dini_Get(file, "News"); format(string, sizeof(string), "Server News: %s", thing); SendClientMessage(playerid, 0x006400FF, string); } else { SendClientMessage(playerid, 0x006400FF, "You have to be logged into RCON in order to change the News!"); } return 1; } |