Jump to content

Cerere comanda /aod


Maffw
 Share

Recommended Posts

  Salutare Bugged as avea nevoie de comanda "/aod" - admin duty in care sa iti dea viata infinita/armura , arme , si o culoare specifica adminilor . Sa fie ceva de genul acesta :

 

if(strcmp(cmd, "/aod", true) == 0)      ... s.a.m.d 

Link to comment
Share on other sites

Am incercat ceva de genul asta dar mi-a dat cateva erori si am incercat sa le rezolv dar nu am reusit

 

 



if(strcmp(cmdtext, "/aod", true)) 
{
if(IsPlayerConnected(playerid))
{
   if(gPlayerLogged[playerid] == 0)
   {
       SendClientMessage(playerid, COLOR_GREY, "   Mai intai trebuie sa fi logat!");
return 1;
   }
   if(PlayerInfo[playerid][pAdmin] > 0)
   {
       if(AdminDuty[playerid] == 0)
       {
           AdminDuty[playerid] = 1;
           SetPlayerArmour(playerid, 99999);
SetPlayerHealth(playerid, 99999);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Administratorul {33CCFF}%s{FF9700} este acum la servici. Foloseste {FF002F}/report {FF9700}daca ai o problema!",sendername);
SendClientMessageToAll(COLOR_Duduianu,string);
if(PlayerInfo[playerid][pAdmin] >= 5)
{
   for(new i = 0; i < sizeof(CarInfo); i++)
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
}
return 1;
       }
       else if(AdminDuty[playerid] == 1)
       {
           AdminDuty[playerid] = 0;
           SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 100);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Administratorul {33CCFF}%s{FF9700} nu mai este la servici.",sendername);
SendClientMessageToAll(COLOR_WHITE,string);
return 1;
       }
   }
   else
   {
       SendClientMessage(playerid, COLOR_GREY, "   You're not the admin !");
       return 1;
   }
}
   return 1;
}

Link to comment
Share on other sites

Okey, iti fac eu. Fii foarte atent la ce fac eu. Ti-o fac pe graba, ca trebuie sa plec.

 

CMD:aod(playerid, params[])

{

SendClientMessageToAll(COLOR_ORANGE, "AdmBot: Adminii sunt online, folositi /report cu incredere pentru orice problema gasita.");

SetPlayerHealth(playerid, 500000);

SendClientMessage(playerid, COLOR_GREY, "Ai primit 500000 viata deoarece esti on duty !");

SetPlayerArmour(playerid, 500000);

SendClientMessage(playerid, COLOR_GREY, "Ai primit 500000 armura deoarece esti on duty !");

SetPlayerColor(playerid, COLOR_RED);

SendClientMessage(playerid, COLOR_GREY, "Ai primit culoarea rosie deoarece esti on duty !");

}

Edited by Jizzy.
Link to comment
Share on other sites

Incearca asta

new aodName[MAX_PLAYER_NAME];
if(strcmp(cmd, "/aod", true) == 0)
{
GetPlayerName(playerid, aodName, sizeof(playername));

if(IsPlayerConnected( playerid ))
{
if(PlayerInfo[ playerid ][pAdmin] >= 1)
{
if(AdminDuty[ playerid ] == 1)
{
format(string, sizeof(string), "Admin %s[AOD] is no loger on Duty.", aodName);
SendClientMessageToAll(0x756FEEFF,string);
AdminDuty[ playerid ] = 0;
SetPlayerHealth( playerid ,100);
SetPlayerArmour( playerid ,0);
SetPlayerToTeamColor( playerid );
}
else
{
format(string, sizeof(string), "Admin %s is now on Duty.", aodName);
SendClientMessageToAll(0x8E4D31FF,string);
AdminDuty[ playerid ] = 1;
SetPlayerHealth(playerid,99999);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
SetPlayerToTeamColor( playerid );
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, " Your not an admin !");
}
return 1;
}
}

 

Vezi ca intre [ playerid ] am lasat niste spati sa le stergi , la fel ca si la ( playerid )

Edited by StarRo
Link to comment
Share on other sites

 

Am incercat ceva de genul asta dar mi-a dat cateva erori si am incercat sa le rezolv dar nu am reusit
 
 
if(strcmp(cmdtext, "/aod", true)) 
{
if(IsPlayerConnected(playerid))
{
   if(gPlayerLogged[playerid] == 0)
   {
       SendClientMessage(playerid, COLOR_GREY, "   Mai intai trebuie sa fi logat!");
return 1;
   }
   if(PlayerInfo[playerid][pAdmin] > 0)
   {
       if(AdminDuty[playerid] == 0)
       {
           AdminDuty[playerid] = 1;
           SetPlayerArmour(playerid, 99999);
SetPlayerHealth(playerid, 99999);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Administratorul {33CCFF}%s{FF9700} este acum la servici. Foloseste {FF002F}/report {FF9700}daca ai o problema!",sendername);
SendClientMessageToAll(COLOR_Duduianu,string);
if(PlayerInfo[playerid][pAdmin] >= 5)
{
   for(new i = 0; i < sizeof(CarInfo); i++)
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
}
return 1;
       }
       else if(AdminDuty[playerid] == 1)
       {
           AdminDuty[playerid] = 0;
           SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 100);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Administratorul {33CCFF}%s{FF9700} nu mai este la servici.",sendername);
SendClientMessageToAll(COLOR_WHITE,string);
return 1;
       }
   }
   else
   {
       SendClientMessage(playerid, COLOR_GREY, "   You're not the admin !");
       return 1;
   }
}
   return 1;
}

 

Link to comment
Share on other sites

Incearca asta

new aodName[MAX_PLAYER_NAME];

if(strcmp(cmd, "/aod", true) == 0)

{

GetPlayerName(playerid, aodName, sizeof(playername));

 

if(IsPlayerConnected( playerid ))

{

if(PlayerInfo[ playerid ][pAdmin] >= 1)

{

if(AdminDuty[ playerid ] == 1)

{

format(string, sizeof(string), "Admin %s[AOD] is no loger on Duty.", aodName);

SendClientMessageToAll(0x756FEEFF,string);

AdminDuty[ playerid ] = 0;

SetPlayerHealth( playerid ,100);

SetPlayerArmour( playerid ,0);

SetPlayerToTeamColor( playerid );

}

else

{

format(string, sizeof(string), "Admin %s is now on Duty.", aodName);

SendClientMessageToAll(0x8E4D31FF,string);

AdminDuty[ playerid ] = 1;

SetPlayerHealth(playerid,99999);

for(new i = 0; i < MAX_PLAYERS; i ++)

{

if(IsPlayerConnected(i))

{

SetPlayerToTeamColor( playerid );

}

}

}

}

else

{

SendClientMessage(playerid, COLOR_WHITE, " Your not an admin !");

}

return 1;

}

}

 

Vezi ca intre [ playerid ] am lasat niste spati sa le stergi , la fel ca si la ( playerid )

 

Incearca asta

new aodName[MAX_PLAYER_NAME];

if(strcmp(cmd, "/aod", true) == 0)

{

GetPlayerName(playerid, aodName, sizeof(playername));

 

if(IsPlayerConnected( playerid ))

{

if(PlayerInfo[ playerid ][pAdmin] >= 1)

{

if(AdminDuty[ playerid ] == 1)

{

format(string, sizeof(string), "Admin %s[AOD] is no loger on Duty.", aodName);

SendClientMessageToAll(0x756FEEFF,string);

AdminDuty[ playerid ] = 0;

SetPlayerHealth( playerid ,100);

SetPlayerArmour( playerid ,0);

SetPlayerToTeamColor( playerid );

}

else

{

format(string, sizeof(string), "Admin %s is now on Duty.", aodName);

SendClientMessageToAll(0x8E4D31FF,string);

AdminDuty[ playerid ] = 1;

SetPlayerHealth(playerid,99999);

for(new i = 0; i < MAX_PLAYERS; i ++)

{

if(IsPlayerConnected(i))

{

SetPlayerToTeamColor( playerid );

}

}

}

}

else

{

SendClientMessage(playerid, COLOR_WHITE, " Your not an admin !");

}

return 1;

}

}

 

Vezi ca intre [ playerid ] am lasat niste spati sa le stergi , la fel ca si la ( playerid )

Link to comment
Share on other sites

 

 

Am incercat ceva de genul asta dar mi-a dat cateva erori si am incercat sa le rezolv dar nu am reusit
 
 
if(strcmp(cmdtext, "/aod", true)) 
{
if(IsPlayerConnected(playerid))
{
   if(gPlayerLogged[playerid] == 0)
   {
       SendClientMessage(playerid, COLOR_GREY, "   Mai intai trebuie sa fi logat!");
return 1;
   }
   if(PlayerInfo[playerid][pAdmin] > 0)
   {
       if(AdminDuty[playerid] == 0)
       {
           AdminDuty[playerid] = 1;
           SetPlayerArmour(playerid, 99999);
SetPlayerHealth(playerid, 99999);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Administratorul {33CCFF}%s{FF9700} este acum la servici. Foloseste {FF002F}/report {FF9700}daca ai o problema!",sendername);
SendClientMessageToAll(COLOR_Duduianu,string);
if(PlayerInfo[playerid][pAdmin] >= 5)
{
   for(new i = 0; i < sizeof(CarInfo); i++)
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
}
return 1;
       }
       else if(AdminDuty[playerid] == 1)
       {
           AdminDuty[playerid] = 0;
           SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 100);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Administratorul {33CCFF}%s{FF9700} nu mai este la servici.",sendername);
SendClientMessageToAll(COLOR_WHITE,string);
return 1;
       }
   }
   else
   {
       SendClientMessage(playerid, COLOR_GREY, "   You're not the admin !");
       return 1;
   }
}
   return 1;
}

 

 

Buni scripteri, intr-adevar, unde este declarata variabila AdminDuty[MAX_PLAYERS]?

 

Varianta facuta pe loc

new AOD[MAX_PLAYERS];
CMD:aod(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        if(AOD[playerid] == 0)
        {
            SetPlayerHealth(playerid, 90000);
            SetPlayerSkin(playerid, 217);
            GivePlayerWeapon(playerid, 38, 40000);
        }
        else
        {
            SetPlayerHealth(playerid, 100);
            SetPlayerSkin(playerid, 1);
            GivePlayerWeapon(playerid, 38, 0);
        }
    }
    return 1;
}
Edited by bGd.TWINGO
  • Upvote 1
Link to comment
Share on other sites

 

Buni scripteri, intr-adevar, unde este declarata variabila AdminDuty[MAX_PLAYERS]?

 

Varianta facuta pe loc

new AOD[MAX_PLAYERS];
CMD:aod(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        if(AOD[playerid] == 0)
        {
            SetPlayerHealth(playerid, 90000);
            SetPlayerSkin(playerid, 217);
            GivePlayerWeapon(playerid, 38, 40000);
        }
        else
        {
            SetPlayerHealth(playerid, 100);
            SetPlayerSkin(playerid, 1);
            GivePlayerWeapon(playerid, 38, 0);
        }
    }
    return 1;
}

Bun scripter mai esti si tu, Twingo, unde scrii mesajul "Administratorul x este la servici" ? Altfel, n-ai de unde stii ca e duty. 

Link to comment
Share on other sites

Bun scripter mai esti si tu, Twingo, unde scrii mesajul "Administratorul x este la servici" ? Altfel, n-ai de unde stii ca e duty. 

Te rog sa verifici sistemele facute de mine inainte de a comenta, nimeni de aici n-a fost in stare sa faca /oplace de exemplu ^.^.

Exista /admins si poti vedea acolo daca e disponibil sau nu cu ajutorul AOD[MAX_PLAYERS]

new adminduty[50];
if(AdminDuty[i] == 1) adminduty = "{DC0C0C}- ON DUTY";
        else if(AdminDuty[i] == 0) adminduty = "";
        if(PlayerInfo[i][pAdmin] >= 1)
        {
            format(gString, sizeof(gString),"Admin Level %d - {DC0C0C}%s ({FFFFFF}%d{DC0C0C}) %s", PlayerInfo[i][pAdmin], GetName(i),i,adminduty);
            SendClientMessage(playerid, COLOR_WHITE, gString);
        }

Btw, daca esti mai bun te invit la chall

Edited by bGd.TWINGO
  • Upvote 1
Link to comment
Share on other sites

Fa-mi sistemul oplace exact ca de pe bugged, daca il faci, complet, jur ca nu o sa mai auzi numele meu. Bafta ;)

Este deja facut si se da prin pm ;) Unde vezi /oplace sa stii ca de mine e facut. Oricum, dupa comentariul de mai sus putin probabil sa-l obtii de la mine. Poate iei si tu o frantura de cod de la cei care-l au deja.

 

// http://pastebin.com/Rw[?]aHZBknu este versiunea finala. ultima versiune o tin doar pentru mine, daca ajunge acel sistem la newbies iar o sa ma trezesc cu creditele modificate. ii lipseste o litera din url, gaseste singur si vei avea sistemul.

Edited by Donboo
Link to comment
Share on other sites

Aoleo, tu crezi ca stau eu sa gasesc singur o litera din 22 de litere ? Aia crezi tu, 2 secunde, il incerc, daca e bun, ma tin de promisiune. Si nu, nu iau nici o frantura de cod, eu te-am pus sa-l dai aici ? Poti da edit, da-l in privat, stai linistit, nu fac nici un server pe oplace-ul tau ;)

 

EDIT: error 010: invalid function or declaration

error 017: undefined symbol "gString"
error 017: undefined symbol "gString"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Edited by Jizzy.
Link to comment
Share on other sites

 

Aoleo, tu crezi ca stau eu sa gasesc singur o litera din 22 de litere ? Aia crezi tu, 2 secunde, il incerc, daca e bun, ma tin de promisiune. Si nu, nu iau nici o frantura de cod, eu te-am pus sa-l dai aici ? Poti da edit, da-l in privat, stai linistit, nu fac nici un server pe oplace-ul tau ;)

 

EDIT: error 010: invalid function or declaration

error 017: undefined symbol "gString"
error 017: undefined symbol "gString"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

 

Cum am zis, bun scripter.. defineste gString.. vezi ca e string ;)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.