AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   MOTD Problem (https://forums.alliedmods.net/showthread.php?t=215002)

Spy123 05-02-2013 11:08

MOTD Problem
 
Hi I have this plugin from a friend:

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <colorchat>

#define PLUGIN "MOTD"
#define VERSION "1.0"
#define AUTHOR "InClus"
    
public plugin_init() {
    
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_clcmd("say /regulament""clcmdShowReg", -1"");
    
register_clcmd("say /reguli""clcmdShowReg", -1"");
    
register_clcmd("say /rules""clcmdShowRul", -1"");
    
register_clcmd("say /ajutor""clcmdShowAj", -1"");
    
register_clcmd("say /blacklist""clcmdShowBL"ADMIN_KICK"Black List");
    
register_clcmd("say /dex""clcmdShowDex", -1"");
    
register_clcmd("say /dictionar""clcmdShowDex", -1"");
    
}

public 
clcmdShowBL(idlevelcid)
{
    if(!
cmd_access(idlevelcid0)){
        
ColorChat(idGREEN"^4[WATF] ^1Sorry! Only admins can view the blacklist!")
        return 
PLUGIN_HANDLED
    
}
    
    new 
szMotd[2047], iLen;
    
    
iLen format(szMotdsizeof szMotd 1,"<body bgcolor=#000000><font color=#87cefa><pre>");
    
iLen += format(szMotd[iLen], (sizeof szMotd 1) - iLen"<center><h2><font color=^"red^">Black List:</font></h2></center>^n");
    
iLen += format(szMotd[iLen], (sizeof szMotd 1) - iLen"<center><b>ISSENGARD ;O^n</b></center>");
    
iLen += format(szMotd[iLen], (sizeof szMotd 1) - iLen"<center><b>Macho^n</b></center>");
    
iLen += format(szMotd[iLen], (sizeof szMotd 1) - iLen"<center><b>Trollolom^n</b></center>");
    
iLen += format(szMotd[iLen], (sizeof szMotd 1) - iLen"<center><b>lotto^n</b></center>");
    
iLen += format(szMotd[iLen], (sizeof szMotd 1) - iLen"<center><b>tatarusanu^n</b></center>");
    
iLen += format(szMotd[iLen], (sizeof szMotd 1) - iLen"<center><b>Ketchup (79.114.144.66)^n</b></center>");
    
iLen += format(szMotd[iLen], (sizeof szMotd 1) - iLen"<center><b>SpraY (79.113.183.36)^n</b></center>");
    
iLen += format(szMotd[iLen], (sizeof szMotd 1) - iLen"<center><b>Sp!Ke (SPIKEONE)^n</b></center>");
    
show_motd(idszMotd"Blacklist")
    return 
PLUGIN_HANDLED
}

public 
clcmdShowReg(id)
{
    new 
szMotd[2047], iLen;
    
    
iLen formatex(szMotdsizeof szMotd 1,"<body bgcolor=#000000><font color=#87cefa><pre>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<center><h2><font color=^"green^">Regulamentul Serverului SOCCERJAM.WATF.RO</font></h2></center>^n^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"red^">1.Reguli Generale:^n</font></b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Nu jucati cu coduri (Speed/Aim) -=> EXTERMINATE + Ban Permanent^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Nu folositi un limbaj vulgar in perioada 07:00-23:59 -=> Gag/Kick/Ban 50min^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Nu folositi script-uri in exces -=> Slay/Kick/Ban 100min.^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Nu faceti reclama la alte servere -=> Ban 1000min/EXTERMINATE^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Cererile de slot/admin/unban NU se fac pe server (de asta exista forum) -=> Gag/Kick^n^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"green^">Atentie:^n</font></b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Intre 00:00 si 07:00 chat-ul este free. (regula pusa la cererea jucatorilor)^n^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"red^">2.Reguli in Joc:^n</font></b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Nu faceti trick-uri in exces -=> Slay/Kick/Ban 50min^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Jucati in pase -=> Slay/Kick/Ban 50min^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Nu se da gol fara Gk (portar) (la hartile cu alien) - indiferent ca a fost din centrare/careul mic/ca s-a terminat runda/etc -=> Kick/Ban 50min^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Nu stati mai mult de 1 minut in tribune (pe persoana) -=> Slay/Kick/Ban 50min^n^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"green^">Atentie:^n</font></b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Daca nu se afla nici un gk in poarta si ai ajuns cu mingea la linia careului mare,astepti pana intra cineva!^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Daca refuza sa intre si te ataca,atunci poti da gol fara gk!^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"La hartile fara alien,puteti da gol fara gk!^n^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">Good Luck & Fave Hun!^n</font></b>");
    
    
show_motd(idszMotd"Regulament");
}

public 
clcmdShowRul(id)
{
    new 
szMotd[2047], iLen;
    
    
iLen formatex(szMotdsizeof szMotd 1,"<body bgcolor=#000000><font color=#87cefa><pre>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<center><h2><font color=^"green^">Server Rules SOCCERJAM.WATF.RO</font></h2></center>^n^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"red^">1.General Rules:^n</font></b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Don't play with codes (Speed/Aim) -=> EXTERMINATE + Ban Permanent^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Don't use a foul language between 07:00-23:59 -=> Gag/Kick/Ban 50min^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Don't use script in excess -=> Slay/Kick/Ban 100min.^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Don't advertise other servers -=> Ban 1000min/EXTERMINATE^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Request slot/admin/unban not make at the server! (Use forum: WWW.WATF.RO) -=> Gag/Kick^n^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"green^">Attention:^n</font></b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Between 00:00 and 07:00 the chat is free. (rule put at the request of the players)^n^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"red^">2.Rules in the Game:^n</font></b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Don't make tricks in excess -=> Slay/Kick/Ban 50min^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Play in pass -=> Slay/Kick/Ban 50min^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Don't score without Gk (goal-keeper) (at the maps with alien) - wether it was from centering/small box/round is over/etc -=> Kick/Ban 50min^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Don't stay more then a minute in the backers (per person) -=> Slay/Kick/Ban 50min^n^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"green^">Attention:^n</font></b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"if there is no gk in the goal and you are with the ball at the line of the penalty box,you will wait until someone will go GK!^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"If he refuse to go and he attack's you,then you can score without gk!^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"At the map without alien,you can score without gk!^n^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">Good Luck & Fave Hun!^n</font></b>");
    
    
show_motd(idszMotd"Rules");
}

public 
clcmdShowAj(id)
{
    new 
szMotd[2047], iLen;
    
    
iLen formatex(szMotdsizeof szMotd 1,"<body bgcolor=#000000><font color=#87cefa><pre>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<center><h2><font color=^"green^">Controale + Sfaturi SoccerJam</font></h2></center>^n^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"red^">1.Miscari:^n</font></b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"SUT - apasa E (sau seteaza in consola: bind e +use)^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"PASE - apasa E (sau seteaza in consola: bind e +use)^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"TURBO - apasa G (sau seteaza in consola: bind g +drop)^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"EFECT STANGA - apasa Z (sau seteaza in consola: bind z radio1)^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"EFECT DREAPTA - apasa X (sau seteaza in consola: bind x radio2)^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"SKILL-URI - apasa Q (sau seteaza in consola: bind q +lastinv)^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"DIVE (saritura mare) - A sau D + Jump^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"CATCH (cum prinzi mingea) - Intri in ea^n^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"green^">Atentie:^n</font></b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Ca sa dai cu efect,trbuie sa ai mingea.Apesi X sau Z (depinde in ce parte vrei efectul - dreapta/stanga) 1 sau 2 ori (depinde cat de mult efect vrei - 15/30 grade) si apesi E!^n^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"red^">2.Skill-urile:^n</font></b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"STAMINA - Iti mareste HP-u'^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"STRENGH - Iti mareste forta sutului si iti cresc sansele sa omori adversarii cu mingea (BALL KILLS)^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"AGILITY - Iti mareste viteza^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"DEXTERITY - Iti cresc sansele sa prinzi mingea fara smack (fara izbire/fara sa pierzi HP)^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"DISARM - Il faci pe adversarul care e la minge sa o scape si in acelasi timp poti dezarma^n^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"green^">Atentie:^n</font></b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Folosesteti XP pentru ati upgrada skill-urile!^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"red^">3.Power Play:^n</font></b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Power Play-ul iti da bonus pentru Strengh si Agility (+putere sut/+viteza)!^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"Jucand multe pase cu coechipierii,niveul power play-ului creste (NIVEL MAX = 5)!^n^n");
    
    
show_motd(idszMotd"Ajutor");
}

public 
clcmdShowDex(id)
{
    new 
szMotd[2047], iLen;
    
    
iLen formatex(szMotdsizeof szMotd 1,"<body bgcolor=#000000><font color=#87cefa><pre>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<center><h2><font color=^"green^">Dictionar SoccerJam</font></h2></center>^n^n");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">alien</font> = extraterestrii de deasupra portilor^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">boost</font> = saritura facuta cu ajutorul turboului + strafe^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">strafe/dive</font> = saritura facuta cu a/d +space^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">tricks</font> = tricuri/scheme^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">pure</font> = trickul facut cu dive - dai mingea in pamant si o prinzi^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">hax</font> = trickul folosit impotriva alienului pentru a nu muri cu mingea la picior in careul advers^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">gk</font> = goalkeeper (portar)^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">defender</font> = fundas^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">trail/beam</font> = linia colorata din spatele mingii^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">hunts/hunturi</font> = omoruri cu cutitul^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">goal saves/gs</font> = mingi aparate^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">power play</font> = putere de joc (iti creste nivelul daca joci multe pase cu coechipierii)^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">stats</font> = statistica^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">skills/skilluri</font> = abilitatile care le ai (apasa Q)^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">curve</font> = efect^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">ball jumps/bj</font> = trick - dai mingea in pamant si sari pe ea - te ridici de la sol^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"yellow^">mid/middle</font> = mijloc^n^n</b>");
    
iLen += formatex(szMotd[iLen], (sizeof szMotd 1) - iLen"<b><font color=^"red^">Good Luck & Fave Hun!^n</font></b>");
    
    
show_motd(idszMotd"Dex");


And I get a lots of "loose identitation"..is there another plugin like this but without this warning? Or someone can edit for me to disappear "loose identitation"?

wickedd 05-02-2013 11:30

Re: MOTD Problem
 
You can ignore those warnings or if you really want to fix them just search "loose indentation" on the forum

Backstabnoob 05-02-2013 12:45

Re: MOTD Problem
 
You probably have more spaces than allowed on a few lines; as said, you don't have to care about those warnings.
AMXX studio should be able to indent the code for you, there's a function for it.

Also, formatting such a large string is retarded, there's no reason for it if the text never changes, just put it directly into show_motd or use a constant.

claudiuhks 05-02-2013 13:05

Re: MOTD Problem
 
I suggest you to indent lines using Notepad Plus Plus software.
Check the explanation for Romanian language: http://dexonline.ro/definitie/indentare

Spy123 05-02-2013 18:49

Re: MOTD Problem
 
Thank you guys! Done with AMXX Studio..CTRL + i :D


All times are GMT -4. The time now is 10:50.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.