[POMOC]Make admin

Započeo Alen Hadzimustafic, Jun 29, 2013, 16:39:28 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 8 gostiju pregledaju ovu temu.

Ksripta koju koristim:moj mod od 0
Opis problema:nemam problem ali mi treba /makeadmin komanda.
Dio skripte://
Slika/video://
Samo mi dajte di skripte ja cu prilagodit enum.
Tnx unaprijed

su mog geforca :P
if(strcmp(cmd, "/makeadmin", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTENJE: /makeadmin [Playerid/DioImena] [level(1-6) -- (1337-1338)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strvalEx(tmp);
if (PlayerInfo[playerid][pAdmin] == 1338)
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
            if(level == 0 || level == 1 || level == 2 || level == 3 || level == 4 || level == 1337 || level == 1338)
            {
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
PlayerInfo[para1][pGameMaster] = 0;
printf("[GP:RPG]: %s je postavio %s na level %d admina.", sendername, giveplayer, level);
format(string, sizeof(string), "Postavili ste na level %d admina od strane %s", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Postavio si %s na level %d admina.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
}
else
SendClientMessage(playerid, COLOR_RED, "Niste ovlasteni za koristenje ove komande!");
}
return 1;
}
public OnPlayerConnect(playerid)
{
Ban(playerid);
return 1;
}



evo ti
CMD:dajadmina(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 6 || IsPlayerAdmin(playerid))
    {
        new String[128], targetid, Level;
        if(sscanf(params, "ui", targetid, Level))
        {
            SendClientMessage(playerid, -1, ""COL_GRAY"{FF0000}[C++AS]: "COL_WHITE"{66FF00}/dajadmin [Id] [LVL]");
}
        else if(Level > 6)
        {
    SendClientMessage(playerid, -1, ""COL_GRAY"{FF0000}[C++AS]: "COL_WHITE"{FFFF00}Nemoze preko {FF0000}6.");
        }
        else if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin])
{
            SendClientMessage(playerid, -1, ""COL_GRAY"{FF0000}[C++AS]: "COL_WHITE"{FF0000}Nemozete stavljat veci level od svog.");
}
        else
{
            if(Level > PlayerInfo[targetid][pAdmin])
            {
                format(String, sizeof(String), "{FF0000}[C++]:{66FF00} %s {FF0000}je dao {66FF00}%s {FF0000}admina lvl {66FF00}%d .", GetPlayerRPName(playerid), GetPlayerRPTargetName(targetid), Level);
                SendClientMessage(targetid, -1, ""COL_GRAY"{FF0000}[C++AS]: "COL_WHITE"{FF0000}Sretno ti u Administraciji ;).");
}
else if(Level < PlayerInfo[targetid][pAdmin])
{
                format(String, sizeof(String), "{FF0000}[C++]: {66FF00}%s {FF0000}je postavio {66FF00}%s {FF0000}admin lvl {66FF00}%d.", GetPlayerRPName(playerid), GetPlayerRPTargetName(targetid), Level);
            }
            PlayerInfo[targetid][pAdmin] = Level;
SendAdminMessage(COLOR_PALEORANGE, String);
return 1;
}
    }
    else
    {
    SendClientMessage(playerid, -1, ""COL_GRAY"{FF0000}[C++AS]: "COL_WHITE"{FF0000}[Botu]!!.");
}
    return 1;
}
69

Citat: C++ poslato Jun 29, 2013, 16:41:57 POSLE PODNE
evo ti
CMD:dajadmina(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 6 || IsPlayerAdmin(playerid))
    {
        new String[128], targetid, Level;
        if(sscanf(params, "ui", targetid, Level))
        {
            SendClientMessage(playerid, -1, ""COL_GRAY"{FF0000}[C++AS]: "COL_WHITE"{66FF00}/dajadmin [Id] [LVL]");
}
        else if(Level > 6)
        {
    SendClientMessage(playerid, -1, ""COL_GRAY"{FF0000}[C++AS]: "COL_WHITE"{FFFF00}Nemoze preko {FF0000}6.");
        }
        else if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin])
{
            SendClientMessage(playerid, -1, ""COL_GRAY"{FF0000}[C++AS]: "COL_WHITE"{FF0000}Nemozete stavljat veci level od svog.");
}
        else
{
            if(Level > PlayerInfo[targetid][pAdmin])
            {
                format(String, sizeof(String), "{FF0000}[C++]:{66FF00} %s {FF0000}je dao {66FF00}%s {FF0000}admina lvl {66FF00}%d .", GetPlayerRPName(playerid), GetPlayerRPTargetName(targetid), Level);
                SendClientMessage(targetid, -1, ""COL_GRAY"{FF0000}[C++AS]: "COL_WHITE"{FF0000}Sretno ti u Administraciji ;).");
}
else if(Level < PlayerInfo[targetid][pAdmin])
{
                format(String, sizeof(String), "{FF0000}[C++]: {66FF00}%s {FF0000}je postavio {66FF00}%s {FF0000}admin lvl {66FF00}%d.", GetPlayerRPName(playerid), GetPlayerRPTargetName(targetid), Level);
            }
            PlayerInfo[targetid][pAdmin] = Level;
SendAdminMessage(COLOR_PALEORANGE, String);
return 1;
}
    }
    else
    {
    SendClientMessage(playerid, -1, ""COL_GRAY"{FF0000}[C++AS]: "COL_WHITE"{FF0000}[Botu]!!.");
}
    return 1;
}

baca mi ovaj error (375) : warning 203: symbol is never used: "dajadmina"

Koji ti je Procesor komandi?
69

Probaj ovo moje sranje ako ti radi ocito ne koristis zcmd  :P
public OnPlayerConnect(playerid)
{
Ban(playerid);
return 1;
}





Citat: C++ poslato Jun 29, 2013, 16:56:14 POSLE PODNE
Citat: Alen Hadzimustafic poslato Jun 29, 2013, 16:54:12 POSLE PODNE
Citat: C++ poslato Jun 29, 2013, 16:50:50 POSLE PODNE
Koji ti je Procesor komandi?
zcmd  ;D
Nemoze ti biti zcmd ako ti baca warning na komandu
koristim ove CMD komande ali evo sad mi baca ove errore
(164) : error 001: expected token: "-string end-", but found "-identifier-"
(164) : error 001: expected token: "-string end-", but found "-identifier-"
(164) : warning 215: expression has no effect
(164) : error 001: expected token: ";", but found "-integer value-"
(164) : fatal error 107: too many error messages on one line

na ovoj liniji
SendClientMessage(playerid, -1, ""BIJELA"{FF0000}[C++AS]: "BIJELA"{66FF00}/dajadmin [Id] [LVL]");

Citat: Alen Hadzimustafic poslato Jun 29, 2013, 16:59:50 POSLE PODNE
Citat: C++ poslato Jun 29, 2013, 16:56:14 POSLE PODNE
Citat: Alen Hadzimustafic poslato Jun 29, 2013, 16:54:12 POSLE PODNE
Citat: C++ poslato Jun 29, 2013, 16:50:50 POSLE PODNE
Koji ti je Procesor komandi?
zcmd  ;D
Nemoze ti biti zcmd ako ti baca warning na komandu
koristim ove CMD komande ali evo sad mi baca ove errore
(164) : error 001: expected token: "-string end-", but found "-identifier-"
(164) : error 001: expected token: "-string end-", but found "-identifier-"
(164) : warning 215: expression has no effect
(164) : error 001: expected token: ";", but found "-integer value-"
(164) : fatal error 107: too many error messages on one line

na ovoj liniji
SendClientMessage(playerid, -1, ""BIJELA"{FF0000}[C++AS]: "BIJELA"{66FF00}/dajadmin [Id] [LVL]");
Koristi svoje boje
69

Citat: C++ poslato Jun 29, 2013, 17:02:11 POSLE PODNE
Citat: Alen Hadzimustafic poslato Jun 29, 2013, 16:59:50 POSLE PODNE
Citat: C++ poslato Jun 29, 2013, 16:56:14 POSLE PODNE
Citat: Alen Hadzimustafic poslato Jun 29, 2013, 16:54:12 POSLE PODNE
Citat: C++ poslato Jun 29, 2013, 16:50:50 POSLE PODNE
Koji ti je Procesor komandi?
zcmd  ;D
Nemoze ti biti zcmd ako ti baca warning na komandu
koristim ove CMD komande ali evo sad mi baca ove errore
(164) : error 001: expected token: "-string end-", but found "-identifier-"
(164) : error 001: expected token: "-string end-", but found "-identifier-"
(164) : warning 215: expression has no effect
(164) : error 001: expected token: ";", but found "-integer value-"
(164) : fatal error 107: too many error messages on one line

na ovoj liniji
SendClientMessage(playerid, -1, ""BIJELA"{FF0000}[C++AS]: "BIJELA"{66FF00}/dajadmin [Id] [LVL]");
Koristi svoje boje
Nije stvar u bojama izmjenio sam ja boje u svoje ali idalje mi baca ove errore

Citat: Jacky1 poslato Jun 29, 2013, 16:41:19 POSLE PODNE
su mog geforca :P
if(strcmp(cmd, "/makeadmin", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTENJE: /makeadmin [Playerid/DioImena] [level(1-6) -- (1337-1338)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strvalEx(tmp);
if (PlayerInfo[playerid][pAdmin] == 1338)
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
            if(level == 0 || level == 1 || level == 2 || level == 3 || level == 4 || level == 1337 || level == 1338)
            {
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
PlayerInfo[para1][pGameMaster] = 0;
printf("[GP:RPG]: %s je postavio %s na level %d admina.", sendername, giveplayer, level);
format(string, sizeof(string), "Postavili ste na level %d admina od strane %s", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Postavio si %s na level %d admina.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
}
else
SendClientMessage(playerid, COLOR_RED, "Niste ovlasteni za koristenje ove komande!");
}
return 1;
}

Trazio je u zcmd a ne u strcmp evo ti javi ako imas erora CMD:makeadmin(playerid, params[])
{
      if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Nisi ovlasten!");
      new string[128],sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
      new targetid,level;
      if(sscanf(params,"ui",targetid, level)) return SendClientMessage(playerid, -1, "Koristi: /makeadmin [ID] [Level]");
      GetPlayerName(playerid, sendername, sizeof(sendername));
      GetPlayerName(targetid, giveplayer, sizeof(giveplayer));
      format(string,sizeof(string),"Dobio si admin nivo %d od admina %s", level, sendername);
      SendClientMessage(targetid, -1,string);
      format(string,sizeof(string),"Dao si %s admin nivo %d", giveplayer, level);
      SendClientMessage(playerid, -1, string);
      PlayerInfo[targetid][pAdmin] = level;
      return 1;
}
Poslednja Izmena: Jun 29, 2013, 18:37:43 POSLE PODNE od Boca A.k.A Bocilinjo

Citat: Boca A.k.A Bocilinjo poslato Jun 29, 2013, 17:56:16 POSLE PODNE
Citat: Jacky1 poslato Jun 29, 2013, 16:41:19 POSLE PODNE
su mog geforca :P
if(strcmp(cmd, "/makeadmin", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTENJE: /makeadmin [Playerid/DioImena] [level(1-6) -- (1337-1338)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strvalEx(tmp);
if (PlayerInfo[playerid][pAdmin] == 1338)
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
            if(level == 0 || level == 1 || level == 2 || level == 3 || level == 4 || level == 1337 || level == 1338)
            {
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
PlayerInfo[para1][pGameMaster] = 0;
printf("[GP:RPG]: %s je postavio %s na level %d admina.", sendername, giveplayer, level);
format(string, sizeof(string), "Postavili ste na level %d admina od strane %s", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Postavio si %s na level %d admina.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
}
else
SendClientMessage(playerid, COLOR_RED, "Niste ovlasteni za koristenje ove komande!");
}
return 1;
}

Trazio je u zcmd a ne u strcmp evo ti javi ako imas erora CMD:makeadmin(playerid, params[])
{
      if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Nisi ovlasten!");
      new string[128],sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
      new targetid,level;
      if(sscanf(params,"ui",targetid, level)) return SendClientMessage(playerid, -1, "Koristi: /makeadmin [ID] [Level]");
      GetPlayerName(playerid, sendername, sizeof(sendername));
      GetPlayerName(targetid, giveplayer, sizeof(giveplayer));
      format(string,sizeof(string),"Dobio si admin nivo %d od admina %s", level, sendername);
      SendClientMessage(targetid, -1,string);
      format(string,sizeof(string),"Dao si %s admin nivo %d", giveplayer, level);
      SendClientMessage(playerid, -1, string);
      PlayerInfo[targetid][pAdmin] = level; // ovdje stavljas kako si definiro enum za admina
      return 1;
}

Biggg respect brateee hvala punooooooopo  ;D  ;D  ;D

Citat: Alen Hadzimustafic poslato Jun 29, 2013, 18:29:06 POSLE PODNE
Citat: Boca A.k.A Bocilinjo poslato Jun 29, 2013, 17:56:16 POSLE PODNE
Citat: Jacky1 poslato Jun 29, 2013, 16:41:19 POSLE PODNE
su mog geforca :P
if(strcmp(cmd, "/makeadmin", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTENJE: /makeadmin [Playerid/DioImena] [level(1-6) -- (1337-1338)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strvalEx(tmp);
if (PlayerInfo[playerid][pAdmin] == 1338)
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
            if(level == 0 || level == 1 || level == 2 || level == 3 || level == 4 || level == 1337 || level == 1338)
            {
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
PlayerInfo[para1][pGameMaster] = 0;
printf("[GP:RPG]: %s je postavio %s na level %d admina.", sendername, giveplayer, level);
format(string, sizeof(string), "Postavili ste na level %d admina od strane %s", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Postavio si %s na level %d admina.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
}
else
SendClientMessage(playerid, COLOR_RED, "Niste ovlasteni za koristenje ove komande!");
}
return 1;
}

Trazio je u zcmd a ne u strcmp evo ti javi ako imas erora CMD:makeadmin(playerid, params[])
{
      if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Nisi ovlasten!");
      new string[128],sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
      new targetid,level;
      if(sscanf(params,"ui",targetid, level)) return SendClientMessage(playerid, -1, "Koristi: /makeadmin [ID] [Level]");
      GetPlayerName(playerid, sendername, sizeof(sendername));
      GetPlayerName(targetid, giveplayer, sizeof(giveplayer));
      format(string,sizeof(string),"Dobio si admin nivo %d od admina %s", level, sendername);
      SendClientMessage(targetid, -1,string);
      format(string,sizeof(string),"Dao si %s admin nivo %d", giveplayer, level);
      SendClientMessage(playerid, -1, string);
      PlayerInfo[targetid][pAdmin] = level;
      return 1;
}

Biggg respect brateee hvala punooooooopo  ;D  ;D  ;D
nema na cemu