[POMOC] RCON ADMIN

Započeo Marko Horvat, Maj 26, 2012, 09:55:58 PRE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.



Skripta koju koristim:CroatianMafia
Detaljan opis problema:Dakle,ja želim sebi dati admina preko RCONa ali kada se ulogiram i napiÅ¡em /setadmin [mojID] [admin level] i piÅ¡e da nemam ovlasti  :'( hitnooo tream taj dio skripte ako je ikako mogućeee
Dio skripte://
Neke slike/video za lakse dobivanje pomoci(neobavezno):// 
MAPPER NA USLUZI :)


Citat: Claude_ poslato Maj 26, 2012, 10:06:05 PRE PODNE
daj komamndu /setadmin

Evo vidi ovo

//----------------------------------[MAKEADMIN]------------------------------------------------
if(strcmp(cmd, "/makeadmin", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /makeadmin [id/ime/prezime] [level(1-3)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 5)
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf("INFO: %s je stavio %s za level %d admina.", sendername, giveplayer, level);
format(string, sizeof(string), "   Stavljeni ste za level %d admina od %s", level, sendername);
SendClientMessage(para1, COLOR_PLAVA, string);
format(string, sizeof(string), "   Stavili ste %s za Level %d admina.", giveplayer,level);
SendClientMessage(playerid, COLOR_PLAVA, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_CRVENA, "[ERROR] Niste administrator ili ste premalen level [5]");
}
}
return 1;
}
MAPPER NA USLUZI :)

//----------------------------------[MAKEADMIN]------------------------------------------------
if(strcmp(cmd, "/makeadmin", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /makeadmin [id/ime/prezime] [level(1-3)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if (IsPlayerAdmin(playerid))
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf("INFO: %s je stavio %s za level %d admina.", sendername, giveplayer, level);
format(string, sizeof(string), "   Stavljeni ste za level %d admina od %s", level, sendername);
SendClientMessage(para1, COLOR_PLAVA, string);
format(string, sizeof(string), "   Stavili ste %s za Level %d admina.", giveplayer,level);
SendClientMessage(playerid, COLOR_PLAVA, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_CRVENA, "[ERROR] Niste administrator ili ste premalen level [5]");
}
}
return 1;
}
Poslednja Izmena: Maj 26, 2012, 10:21:16 PRE PODNE od ♥Chuck♥

evo onda ja to compile i ovo mi izbaci samo jedan jedini eror

http://www.zaslike.com/viewer.php?file=nxf7u51xpmbljp8ji5wn.jpg

a ovo je kod u BoxEx /*
* Extrrme Box INC
* FNC: CreateBox(playerid,header[],text[])
* Verzija: 1.0
* Credits: ExtremePower, Y_Less ( foreach )
* Za: Balkan-samp.com
*/

#if defined _Box_included
  #endinput
#endif
#define _Box_included
#pragma library Box
#include <foreach>

forward textdrawiskljucise(playerid);

static
       bool:fnc[2] = false;
new
Text:Header[MAX_PLAYERS],
Text:Text[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
     if(fnc[0]) CallLocalFunction("Box_OnPlayerConnect", "i", playerid);
Header[playerid] = TextDrawCreate(28.000000, 125.000000, "croatian mafia");
TextDrawBackgroundColor(Header[playerid], 255);
TextDrawFont(Header[playerid], 2);
TextDrawLetterSize(Header[playerid], 0.430000, 1.999998);
TextDrawColor(Header[playerid], -1);
TextDrawSetOutline(Header[playerid], 0);
TextDrawSetProportional(Header[playerid], 1);
TextDrawSetShadow(Header[playerid], 1);
TextDrawUseBox(Header[playerid], 1);
TextDrawBoxColor(Header[playerid], 13132900);
TextDrawTextSize(Header[playerid], 182.000000, -29.000000);

Text[playerid] = TextDrawCreate(28.000000, 147.000000, "ovo vozilo mozete iznajmiti /rentveh");
TextDrawBackgroundColor(Text[playerid], 255);
TextDrawFont(Text[playerid], 2);
TextDrawLetterSize(Text[playerid], 0.280000, 1.100000);
TextDrawColor(Text[playerid], -1);
TextDrawSetOutline(Text[playerid], 0);
TextDrawSetProportional(Text[playerid], 1);
TextDrawSetShadow(Text[playerid], 1);
TextDrawUseBox(Text[playerid], 1);
TextDrawBoxColor(Text[playerid], 100);
TextDrawTextSize(Text[playerid], 182.000000, 21.000000);
return 1;
}

#if defined _ALS_OnPlayerConnect
#undef OnPlayerConnect
#else
#define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect Box_OnPlayerConnect
forward Box_OnPlayerConnect(playerid);

stock CreateBox(playerid,header[],text[])
{
new
string[128];
format(string, sizeof string,"%s",header);
TextDrawSetString(Text:Header[playerid],string);
TextDrawShowForPlayer(playerid,Text:Header[playerid]);
// Text
format(string, sizeof string,"%s",text);
TextDrawSetString(Text:Text[playerid],string);
TextDrawShowForPlayer(playerid,Text:Text[playerid]);
SetPVarInt(playerid,"CreateBoxEx",1);
SetTimerEx("textdrawiskljucise", 5000, 0, "i", playerid);
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
     if(fnc[0]) CallLocalFunction("Box_OnPlayerKeyStateChange", "i", playerid);
     if(newkeys & KEY_FIRE)
     {
    if(GetPVarInt(playerid,"CreateBoxEx") == 1)
    {
          TextDrawHideForPlayer(playerid,Text:Text[playerid]);
          TextDrawHideForPlayer(playerid,Text:Header[playerid]);
  SetPVarInt(playerid,"CreateBoxEx",0);
    }
}
return 1;
}
#if defined _ALS_OnPlayerKeyStateChange
#undef OnPlayerKeyStateChange
#else
#define _ALS_OnPlayerKeyStateChange
#endif
#define OnPlayerKeyStateChange Box_OnPlayerKeyStateChange
forward Box_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);

public OnGameModeInit()
{
fnc[0] = (funcidx("Box_OnPlayerConnect") != -1);
fnc[1] = (funcidx("Box_OnPlayerKeyStateChange") != -1);
CallLocalFunction("Box_OnGameModeInit", "");
}

#if defined _ALS_OnGameModeInit
#undef OnGameModeInit
#else
#define _ALS_OnGameModeInit
#endif
#define OnGameModeInit Box_OnGameModeInit

forward Box_OnGameModeInit();

public textdrawiskljucise(playerid)
{
TextDrawHideForPlayer(playerid,Text:Text[playerid]);
        TextDrawHideForPlayer(playerid,Text:Header[playerid]);
        return 1;
}
MAPPER NA USLUZI :)

Rješeno može LOCK!
MAPPER NA USLUZI :)