Jump to content
  • 0

[GF/RP] Salut am o problema


anakin29

Question

buna ziua am si eu o problema am facut comanda /ask si ea arata la toti jucatori de pe svr intrebarea si eu nu vreau decat la admini sau helpers ma puteti ajuta?

[pawn] if(strcmp(cmd, "/ask", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

        if(gPlayerLogged[playerid] == 0)

        {

            SendClientMessage(playerid, COLOR_GREY, "  No te has registrado aún!");

            return 1;

        }

if ((nonewbie) && PlayerInfo[playerid][pAdmin] < 1)

{

SendClientMessage(playerid, COLOR_GRAD2, " El Canal ASK ha sido deshabilitado por un administrador!");

return 1;

}

if(PlayerInfo[playerid][pNMuted] == 1)

{

SendClientMessage(playerid, TEAM_CYAN_COLOR, "  Usted está Muteado En el Canal ASK, no puede hablar By Administradores.");

return 1;

}

        new str[160];

    GetPlayerName(playerid, str, MAX_PLAYER_NAME);

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

            if (str == '_')

            str = ' ';

new length = strlen(cmdtext);

while ((idx < length) && (cmdtext[idx] <= ' '))

{

idx++;

}

new offset = idx;

new result[64];

while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))

{

result[idx - offset] = cmdtext[idx];

idx++;

}

result[idx - offset] = EOS;

if(!strlen(result))

{

SendClientMessage(playerid, COLOR_GRAD2, "USA: /ask [text]");

return 1;

}

format(str, sizeof(str), "* [Ask] %s[%i]: %s", str, playerid, result);

SendClientMessageToAll(COLOR_GREEN, "** Para responder a este jugador, /pm [iD] [Answer]");

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

{

    if (IsPlayerConnected(n))

    {

        SendClientMessage(n, COLOR_ORANGE, str);

    }

}

printf("%s", str);

}

return 1;

}[/pawn]

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Pune asa in gm pentru admini:

[pawn]forward ABroadCast(color,const string[],level);[/pawn]

[pawn]public ABroadCast(color,const string[],level)// aici ai string[ ],level),fara spatiu intre [ ]..asa se vede de la forum

{

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

{

if(IsPlayerConnected(i))

{

if (PlayerInfo[pAdmin] >= level)

{

SendClientMessage(i, color, string);

printf("%s", string);

}

}

}

return 1;

}[/pawn]

Pentru helperi faci asa:

[pawn]forward SendHelperMessage(color, string[]);[/pawn]

[pawn]public SendHelperMessage(color, string[])

{

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

{

if(IsPlayerConnected(i))

{

    if(PlayerInfo[pHelper] >= 1)

    {

SendClientMessage(i, color, string);

}

}

}

}[/pawn]

Si la comanda in loc de:

[pawn]format(str, sizeof(str), "* [Ask] %s[%i]: %s", str, playerid, result);

SendClientMessageToAll(COLOR_GREEN, "** Para responder a este jugador, /pm [iD] [Answer]");[/pawn]

Pui:

[pawn]format(str, sizeof(str), "* [Ask] %s[%i]: %s", str, playerid, result);

BroadCast(COLOR_GREEN,string);

SendHelperMessage(COLOR_GREEN,string);

format(str, sizeof(str), "** Para responder a este jugador, /pm [iD] [Answer]", str, playerid);

BroadCast(COLOR_GREEN,string);

SendHelperMessage(COLOR_GREEN,string);[/pawn]

La alte comenzi..doar pentru admin folosesti BroadCast(COLOR_GREEN,string);

pentru helperi folosesti SendHelperMessage(COLOR_GREEN,string);

gXvsYS
Link to comment
Share on other sites

Frate uite ce imi da :|

C:\Users\user\Desktop\Sv samp 0\gamemodes\LSRP.pwn(1202) : error 025: function heading differs from prototype

C:\Users\user\Desktop\Sv samp 0\gamemodes\LSRP.pwn(1202) : error 029: invalid expression, assumed zero

C:\Users\user\Desktop\Sv samp 0\gamemodes\LSRP.pwn(1204) : error 010: invalid function or declaration

C:\Users\user\Desktop\Sv samp 0\gamemodes\LSRP.pwn(1206) : error 010: invalid function or declaration

C:\Users\user\Desktop\Sv samp 0\gamemodes\LSRP.pwn(1208) : error 010: invalid function or declaration

C:\Users\user\Desktop\Sv samp 0\gamemodes\LSRP.pwn(1215) : error 010: invalid function or declaration

C:\Users\user\Desktop\Sv samp 0\gamemodes\LSRP.pwn(17445) : error 021: symbol already defined: "ABroadCast"

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

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. For more details you can also review our Terms of Use and Privacy Policy.