[POMOC]Admin sistem...

Započeo [CH]Ivan_Lukic, April 13, 2011, 14:57:05 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Skripta koju koristim: DM svoju od 0
Detaljan opis problema: kad dodam admin komande nmg upalit server...eo pogledajte ovde...
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3c, (C)2005-2010 SA-MP Team

[14:56:32]
[14:56:32] Server Plugins
[14:56:32] --------------
[14:56:32]  Loading plugin: sscanf
[14:56:32]   Failed.
[14:56:32]  Loaded 0 plugins.

[14:56:32]
[14:56:32] Filter Scripts
[14:56:32] ---------------
[14:56:32]   Loading filter script 'laser.amx'...
[14:56:32]
-- Laser Pointer by Skiaffo --

[14:56:32]   Loaded 1 filter scripts.

[14:56:32] Script[gamemodes/BWW.amx]: Run time error 19: "File or function is not found"
[14:56:32] Number of vehicle models: 0
[14:56:34] --- Server Shutting Down.

Dio skripte:Komande
CMD:report(playerid, params[])
{
new str[50];
    if(sscanf(params, "s[50]", str)== 0) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /report [text]");
SendClientMessage(playerid, COLOR_YELLOW, "Your report has been sent to any online admins.");
for(new i=0; i<MAX_PLAYERS; i++)
{
    if(GetAdminLevel(i)>= 1 || IsPlayerAdmin(i))
{
format(str, sizeof(str), "[REPORT] %s: %s", GetPName(playerid), params);
SendClientMessage(i, COLOR_REPORT, str);
}
}
return 1;
}
CMD:ahelp(playerid, params[])
{
if(GetAdminLevel(playerid) >=1 || IsPlayerAdmin(playerid))
{
    SendClientMessage(playerid, COLOR_WHITE, "LEVEL 1");
    SendClientMessage(playerid, COLOR_GRAY, "/respawncar /goto /gethere /apm /repair /freeze /unfreeze /mute /unmute");
}
if(GetAdminLevel(playerid) >=2 || IsPlayerAdmin(playerid))
{
    SendClientMessage(playerid, COLOR_WHITE, "LEVEL 2");
    SendClientMessage(playerid, COLOR_GRAY, "/disarm /respawnallcars /veh /kick /givemoney");
}
if(GetAdminLevel(playerid) >=3 || IsPlayerAdmin(playerid))
{
    SendClientMessage(playerid, COLOR_WHITE, "LEVEL 3");
    SendClientMessage(playerid, COLOR_GRAY, "/ban /akill");
}
if(GetAdminLevel(playerid) >=4 || IsPlayerAdmin(playerid))
{
    SendClientMessage(playerid, COLOR_WHITE, "LEVEL 4");
    SendClientMessage(playerid, COLOR_GRAY, "/sethp");
}
if(GetAdminLevel(playerid) >=5 || IsPlayerAdmin(playerid))
{
    SendClientMessage(playerid, COLOR_WHITE, "LEVEL 5");
    SendClientMessage(playerid, COLOR_GRAY, "/adminlevel /restart");
}
return 1;
}
//LEVEL 1
CMD:spectate(playerid, params[])
{
new giveplayerid, str[128];
if(GetAdminLevel(playerid) >=1) {
    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /spectate [playerid]");
    PlayerSpectatePlayer(playerid, giveplayerid);
    format(str, 128, "You are now spectating %s.", GetPName(giveplayerid));
}
return 1;
}

CMD:respawncar(playerid, params[])
{
new vid;
if(GetAdminLevel(playerid) >= 1) {
if(sscanf(params, "i", vid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /respawncar [VIN]");
new bool:unwanted[MAX_VEHICLES];
for(new player=0; player<MAX_PLAYERS; player++)
{
    if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new i = 1; i <MAX_VEHICLES; i++)
{
if(!unwanted[i]) SetVehicleToRespawn(i);
}
}
return 1;
}
CMD:goto(playerid, params[])
{
if(GetAdminLevel(playerid) >= 1) {
new Float:x, Float:y, Float:z, Float:a, giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /goto [playerid]");
if(!IsPlayerConnected(giveplayerid)) return 1;
GetPlayerPos(giveplayerid, x, y, z);
GetPlayerFacingAngle(giveplayerid, a);
SetPlayerPos(playerid, x-1, y-1, z);
SetPlayerFacingAngle(playerid, a);
}
return 1;
}
CMD:gethere(playerid, params[])
{
if(GetAdminLevel(playerid) >= 1) {
new Float:x, Float:y, Float:z, Float:a, giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gethere [playerid]");
if(!IsPlayerConnected(giveplayerid)) return 1;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
SetPlayerPos(giveplayerid, x-1, y-1, z);
SetPlayerFacingAngle(giveplayerid, a);
}
return 1;
}
CMD:apm(playerid, params[])
{
if(GetAdminLevel(playerid) >= 1) {
new str1[128],str[128], giveplayerid;
if(sscanf(params, "us[50]", giveplayerid, str)== 0) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /apm [playerid] [text]");
if(!IsPlayerConnected(giveplayerid)) return 1;
    format(str1, sizeof(str1), "PM from Administration: %s", params[2]);
    format(str, sizeof(str), "(ADMININFO) {FFFF00}Your admin PM was sent to %i", strval(params));
SendClientMessage(giveplayerid, COLOR_REPORT, str1);
  SendClientMessage(playerid, COLOR_WHITE, str);
}
return 1;
}
CMD:repair(playerid, params[])
{
if(GetAdminLevel(playerid) >= 1) {
if(IsPlayerInAnyVehicle(playerid)) {
    SetVehicleHealth(GetPlayerVehicleID(playerid), 1000);
    RepairVehicle(GetPlayerVehicleID(playerid));
    SendClientMessage(playerid, COLOR_YELLOW, "You have repaired your vehicle.");
}
}
return 1;
}
CMD:freeze(playerid, params[])
{
new giveplayerid, str[128];
if(GetAdminLevel(playerid) >=1 || IsPlayerAdmin(playerid)) {
    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /freeze [playerid]");
if(!IsPlayerConnected(giveplayerid)) return 1;
format(str, 128, "You have frozen %s.", GetPName(giveplayerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "You have been frozen by an administrator.");
TogglePlayerControllable(giveplayerid, 0);
}
return 1;
}
CMD:unfreeze(playerid, params[])
{
new giveplayerid, str[128];
if(GetAdminLevel(playerid) >=1 || IsPlayerAdmin(playerid)) {
    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unfreeze [playerid]");
if(!IsPlayerConnected(giveplayerid)) return 1;
format(str, 128, "You have unfrozen %s.", GetPName(giveplayerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "You have been unfrozen by an administrator.");
TogglePlayerControllable(giveplayerid, 1);
}
return 1;
}
CMD:mute(playerid, params[])
{
new giveplayerid, str[128];
if(GetAdminLevel(playerid) >=1 || IsPlayerAdmin(playerid)) {
if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /mute [playerid]");
if(!IsPlayerConnected(giveplayerid)) return 1;
if(PlayerMuted[giveplayerid] == 0) {
    PlayerMuted[giveplayerid] = 1;
format(str, 128, "You have muted %s.", GetPName(giveplayerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "You have been muted by an administrator.");
}else {
    SendClientMessage(playerid, COLOR_RED, "Player is already muted!");
}
}
return 1;
}
CMD:unmute(playerid, params[])
{
new giveplayerid, str[128];
if(GetAdminLevel(playerid) >=1 || IsPlayerAdmin(playerid)) {
if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unmute [playerid]");
if(!IsPlayerConnected(giveplayerid)) return 1;
if(PlayerMuted[giveplayerid] == 1) {
    PlayerMuted[giveplayerid] = 0;
format(str, 128, "You have unmuted %s.", GetPName(giveplayerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "You have been unmuted by an administrator.");
}else {
    SendClientMessage(playerid, COLOR_RED, "Player is not muted!");
}
}
return 1;
}
CMD:a(playerid, params[])
{
new str[50];
if(GetAdminLevel(playerid) >=1 || IsPlayerAdmin(playerid)) {
if(sscanf(params, "s[50]", str)== 0) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /a [announcement]");
SendClientMessageToAll(COLOR_RED, params);
}
return 1;
}
//LEVEL 2
CMD:disarm(playerid, params[])
{
new giveplayerid, str[128];
if(GetAdminLevel(playerid) >=2 || IsPlayerAdmin(playerid)) {
    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /disarm [playerid]");
if(!IsPlayerConnected(giveplayerid)) return 1;
format(str, 128, "You have disarmed %s.", GetPName(giveplayerid));
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "Your weapons have been reset by an administrator.");
    ResetPlayerWeapons(giveplayerid);
}
return 1;
}
CMD:respawnallcars(playerid, params[])
{
if(GetAdminLevel(playerid) >= 2) {
new bool:unwanted[MAX_VEHICLES];
for(new player=0; player<MAX_PLAYERS; player++)
{
    if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new v = 1; v <= MAX_VEHICLES; v++)
{
if(!unwanted[v]) SetVehicleToRespawn(v);
}
}
return 1;
}
CMD:veh(playerid, params[])
{
if(GetAdminLevel(playerid) >= 2) {
    new car;
    if(IsPlayerInAnyVehicle(playerid)) return 1;
    if(sscanf(params, "i", car)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /veh [vehid]");
    if(strval(params) >611 || strval(params) <400) return SendClientMessage(playerid, COLOR_RED, "Invalid model id!");
    new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x,y,z);
GetPlayerFacingAngle(playerid, a);
car = CreateVehicle(strval(params), x, y, z,a, -1, -1, 60);
PutPlayerInVehicle(playerid, car, 0);
}
return 1;
}
CMD:kick(playerid, params[])
{
new giveplayerid;
if(GetAdminLevel(playerid) >=2 || IsPlayerAdmin(playerid)) {
    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid]");
if(!IsPlayerConnected(giveplayerid)) return 1;
new str[128], str2[128];
format(str, 128, "You have kicked %s from the server.", GetPName(giveplayerid));
format(str2, 128, "You have been kicked from the server by %s.", GetPName(playerid));
SendClientMessage(playerid, COLOR_RED, str);
SendClientMessage(giveplayerid, COLOR_RED, str2);
Kick(giveplayerid);
}
return 1;
}
CMD:givemoney(playerid, params[])
{
if(GetAdminLevel(playerid) >= 2) {
new giveplayerid, money;
if(sscanf(params, "ui", giveplayerid, money)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [playerid] [amount]");
if(!IsPlayerConnected(giveplayerid)) return 1;
GivePlayerMoney(playerid, money);
}
return 1;
}
//LEVEL 3
CMD:akill(playerid, params[])
{
new giveplayerid, str[128];
if(GetAdminLevel(playerid >=3)) {
if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /akill [playerid]");
if(!IsPlayerConnected(giveplayerid)) return 1;
SetPlayerHealth(giveplayerid, 0);
format(str, 128, "You have admin-killed %s.", GetPName(giveplayerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "You have been killed by an administrator.");
}
return 1;
}
CMD:ban(playerid, params[])
{
if(GetAdminLevel(playerid) >= 3) {
new reason[50], giveplayerid, sendername[24], year, month, day, date[128], str[128], str2[128], str3[128], PlayerName[24], file[128];
if(sscanf(params, "us", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ban [playerid] [reason]");
if(!IsPlayerConnected(giveplayerid)) return 1;
getdate(year, month, day);
format(date, sizeof(date), "Date: %02d/%02d/%d", month, day, year);
GetPlayerName(playerid, sendername, 20);
GetPlayerName(giveplayerid, PlayerName, sizeof(PlayerName));
format(file, 128, USER_FILE, PlayerName);
dini_IntSet(file, "Banned", 1);
dini_Set(file, "BannedReason", reason);
dini_Set(file, "BannedBy", sendername);
dini_Set(file, "DateBanned", date);
format(str, 128, "You have banned %s. Reason: %s.",PlayerName, reason);
format(str2, 128, "You have been banned from this server. Reason: %s", reason);
format(str3, 128, "Banned by: %s", sendername);
SendClientMessage(playerid, COLOR_RED, str);
SendClientMessage(giveplayerid, COLOR_RED, str2);
SendClientMessage(giveplayerid, COLOR_RED, str3);
SendClientMessage(giveplayerid, COLOR_RED, date);
SendClientMessage(giveplayerid, COLOR_RED, "Make a ban appeal via the forums.");
Kick(giveplayerid);
}
return 1;
}
//LEVEL 4
CMD:sethp(playerid, params[])
{
new Float:health, giveplayerid, str[128], str2[128];
if(GetAdminLevel(playerid) >=4 || IsPlayerAdmin(playerid)) {
    if(sscanf(params, "ud", giveplayerid, health)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sethp [playerid] [health]");
if(!IsPlayerConnected(giveplayerid)) return 1;
    SetPlayerHealth(giveplayerid, health);
    format(str, 128, "You have set the health of %s to %d.", GetPName(giveplayerid), health);
format(str2, 128, "Your health has been set to %d by an administrator.", health);
SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
  SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, str2);
}
return 1;
}
//LEVEL 5
CMD:restart(playerid, params[])
{
if(GetAdminLevel(playerid) >=5) {
    SendRconCommand("gmx");
}
return 1;
}
CMD:adminlevel(playerid, params[])
{
new giveplayerid, level, str[128], str2[128];
if(GetAdminLevel(playerid) >= 5) {
new file[128]; format(file, 128, USER_FILE, GetPName(giveplayerid));
    if(sscanf(params, "ud", giveplayerid, level)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /adminlevel [playerid] [level 1-5]");
if(!IsPlayerConnected(giveplayerid)) return 1;
if(0 > strval(params[2]) > 5) return SendClientMessage(playerid, COLOR_RED, "Invalid admin level! (1-5)");
    dini_IntSet(file, "AdminLevel", level);
format(str, 128, "You have set the admin level of %s to %d!", GetPName(giveplayerid), level);
format(str2, 128, "%s has set your admin level to %d!", GetPName(playerid), level);
SendClientMessage(playerid,COLOR_LIGHTBLUE, str);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, str2);
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):

  Loading plugin: sscanf
   Failed.



nije ti dobar sscanf

znam ali bez ti komandi radi i mjenjo sam sscanf ali opet neradi..

ocigledno si onda negdje zabrljao kod tih komandi

e a koji mi treba novi sscanf...demi link ako mozes..

poznaticovik

Citat: [CH]Ivan_Lukic poslato April 13, 2011, 15:55:31 POSLE PODNE
znam ali bez ti komandi radi i mjenjo sam sscanf ali opet neradi..

DL od Y_Lessa neradi rekao je i sam , tako da je neki sa SA:MP uradio fix i plugin radi , probat ću naći link i editat temu.

DL: http://www.mediafire.com/?3lf2o02dr0f001l
i dodaj na kraj scripte

stock sscanf(string[], format[], {Float,_}:...)
{
new name[MAX_PLAYER_NAME];
#if defined isnull
if (isnull(string))
#else
if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
#endif
{
return format[0];
}
#pragma tabsize 4
new
formatPos = 0,
stringPos = 0,
paramPos = 2,
paramCount = numargs(),
delim = ' ';
while (string[stringPos] && string[stringPos] <= ' ')
{
stringPos++;
}
while (paramPos < paramCount && string[stringPos])
{
switch (format[formatPos++])
{
case '\0':
{
return 0;
}
case 'i', 'd':
{
new
neg = 1,
num = 0,
ch = string[stringPos];
if (ch == '-')
{
neg = -1;
ch = string[++stringPos];
}
do
{
stringPos++;
if ('0' <= ch <= '9')
{
num = (num * 10) + (ch - '0');
}
else
{
return -1;
}
}
while ((ch = string[stringPos]) > ' ' && ch != delim);
setarg(paramPos, 0, num * neg);
}
case 'h', 'x':
{
new
num = 0,
ch = string[stringPos];
do
{
stringPos++;
switch (ch)
{
case 'x', 'X':
{
num = 0;
continue;
}
case '0' .. '9':
{
num = (num << 4) | (ch - '0');
}
case 'a' .. 'f':
{
num = (num << 4) | (ch - ('a' - 10));
}
case 'A' .. 'F':
{
num = (num << 4) | (ch - ('A' - 10));
}
default:
{
return -1;
}
}
}
while ((ch = string[stringPos]) > ' ' && ch != delim);
setarg(paramPos, 0, num);
}
case 'c':
{
setarg(paramPos, 0, string[stringPos++]);
}
case 'f':
{
setarg(paramPos, 0, _:floatstr(string[stringPos]));
}
case 'p':
{
delim = format[formatPos++];
continue;
}
case '\'':
{
new
end = formatPos - 1,
ch;
while ((ch = format[++end]) && ch != '\'') {}
if (!ch)
{
return -1;
}
format[end] = '\0';
if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
{
if (format[end + 1])
{
return -1;
}
return 0;
}
format[end] = '\'';
stringPos = ch + (end - formatPos);
formatPos = end + 1;
}
case 'u':
{
new
end = stringPos - 1,
id = 0,
bool:num = true,
ch;
while ((ch = string[++end]) && ch != delim)
{
if (num)
{
if ('0' <= ch <= '9')
{
id = (id * 10) + (ch - '0');
}
else
{
num = false;
}
}
}
if (num && IsPlayerConnected(id))
{
setarg(paramPos, 0, id);
}
else
{
#if !defined foreach
#define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
#define __SSCANF_FOREACH__
#endif
string[end] = '\0';
num = false;
id = end - stringPos;
foreach (Player, playerid)
{
GetPlayerName(playerid, name, sizeof (name));
if (!strcmp(name, string[stringPos], true, id))
{
setarg(paramPos, 0, playerid);
num = true;
break;
}
}
if (!num)
{
setarg(paramPos, 0, INVALID_PLAYER_ID);
}
string[end] = ch;
#if defined __SSCANF_FOREACH__
#undef foreach
#undef __SSCANF_FOREACH__
#endif
}
stringPos = end;
}
case 's', 'z':
{
new
i = 0,
ch;
if (format[formatPos])
{
while ((ch = string[stringPos++]) && ch != delim)
{
setarg(paramPos, i++, ch);
}
if (!i)
{
return -1;
}
}
else
{
while ((ch = string[stringPos++]))
{
setarg(paramPos, i++, ch);
}
}
stringPos--;
setarg(paramPos, i, '\0');
}
default:
{
continue;
}
}
while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
{
stringPos++;
}
while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
{
stringPos++;
}
paramPos++;
}
do
{
if ((delim = format[formatPos++]) > ' ')
{
if (delim == '\'')
{
while ((delim = format[formatPos++]) && delim != '\'') {}
}
else if (delim != 'z')
{
return delim;
}
}
}
while (delim > ' ');
return 0;
}


poznaticovik