Jump to content

hledám Hledám script na #/@


Brcko.

Recommended Posts

Zdravím, hledám jeden script na to že když se napíše #(ID) (TEXT) buď je to # nebo @ Teď nevím.

 

Nemáte to někdo prosím ? Hrozně bych to potřeboval

  • Líbí se mi to! (+1) 1
Link to comment
Share on other sites

Wut? Vůbec nechápu, co myslíš. Popis to více.

 

Asi myslí označení hráče v chatu - @ID

 

http://forum.sa-mp.com/showthread.php?t=541509

http://forum.sa-mp.com/showthread.php?t=518521

 

//Edit: Jinak máš to asi ve špatné sekci.. 

Edited by OceT
Link to comment
Share on other sites

Asi myslí označení hráče v chatu - @ID

 

http://forum.sa-mp.com/showthread.php?t=541509

http://forum.sa-mp.com/showthread.php?t=518521

 

//Edit: Jinak máš to asi ve špatné sekci.. 

Ano, Přesně označení hráče v chatu. JInak dal jsem to do pawna hodilo to pár errorů..

C:\Documents and Settings\Pepa\Plocha\playertext.pwn(1) : warning 235: public function lacks forward declaration (symbol "OnPlayerText")
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(4) : error 017: undefined symbol "format"
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(4) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(4) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(4) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(8) : error 017: undefined symbol "strval"
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(10) : error 017: undefined symbol "IsPlayerConnected"
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(11) : error 017: undefined symbol "MAX_PLAYER_NAME"
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(11) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(11) : error 036: empty statement
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(11) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


7 Errors.

Nevíte jak to opravit? icon_e_biggrin.gif

 

Jestli to mám ve špatné sekci tak se omlouvám, když tak to přehoďte :-)

 

Přesněji, potřeboval bych to na svůj Paradise World, blbne mi stím 4. úkol v /ukoly.. :/

Edited by Brcko.
Link to comment
Share on other sites

Ano, Přesně označení hráče v chatu. JInak dal jsem to do pawna hodilo to pár errorů..

C:\Documents and Settings\Pepa\Plocha\playertext.pwn(1) : warning 235: public function lacks forward declaration (symbol "OnPlayerText")
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(4) : error 017: undefined symbol "format"
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(4) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(4) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(4) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(8) : error 017: undefined symbol "strval"
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(10) : error 017: undefined symbol "IsPlayerConnected"
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(11) : error 017: undefined symbol "MAX_PLAYER_NAME"
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(11) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(11) : error 036: empty statement
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(11) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


7 Errors.

Nevíte jak to opravit? icon_e_biggrin.gif

 

Jestli to mám ve špatné sekci tak se omlouvám, když tak to přehoďte :-)

 

Přesněji, potřeboval bych to na svůj Paradise World, blbne mi stím 4. úkol v /ukoly.. :/

 

Asi nemáš nahoře #include <a_samp> 

Edited by OceT
Link to comment
Share on other sites

Hodil jsem o tam + upravil jeden řádek který byl napsán na forumu a teď to hází tohle:

C:\Documents and Settings\Pepa\Plocha\playertext.pwn(9) : error 003: declaration of a local variable must appear in a compound block
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(9) : warning 217: loose indentation
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(9) : error 017: undefined symbol "id"
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(10) : error 017: undefined symbol "id"
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(11) : error 017: undefined symbol "id"
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(13) : warning 217: loose indentation
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(13) : error 017: undefined symbol "id"
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(29) : warning 209: function "OnPlayerText" should return a value
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(30) : error 021: symbol already defined: "SendPlayerMessageToAll"
C:\Documents and Settings\Pepa\Plocha\playertext.pwn(31) : error 010: invalid function or declaration
Link to comment
Share on other sites

Na forum bylo napsané že se musí upravit tohle

if ((string[i + 1] > 47) && (string[i + 1] < 58)) {

Na tohle

if('0' <= string[i + 1] <= '9')

Teď to tam teda vypadá takhle

#include <a_samp>
public OnPlayerText(playerid, text[])
{
  new string[128];
  format(string, sizeof(string), "%s", text);
  for (new i; i < 128; i++) {
    if (string[i] == '@') {
      if('0' <= string[i + 1] <= '9')
          new id = strval(string[i + 1]);
        if (id <= 500) {
         if (IsPlayerConnected(id)) {
            new menohraca[MAX_PLAYER_NAME];
        GetPlayerName(id, menohraca, MAX_PLAYER_NAME);
        new j = (i + 1);
        while ((j < (i + 5)) && ((string[j] > 47) && (string[j] < 58)))
              j++;
        strdel(string, i, j);
        strins(string, menohraca, i, 128);
          } else {
        SendClientMessage(playerid, 0xFF0000FF, "Zlé ID");
        return 0;
      }
        } else {
      SendClientMessage(playerid, 0xFF0000FF, "Zlé ID");
      return 0;
    }
      }
    }
  }
  SendPlayerMessageToAll(playerid, string);
  return 0;
}
Link to comment
Share on other sites

Na forum bylo napsané že se musí upravit tohle

if ((string[i + 1] > 47) && (string[i + 1] < 58)) {

Na tohle

if('0' <= string[i + 1] <= '9')

 

Smazal si tam závorku {

if('0' <= string[i + 1] <= '9')

nahraď na

if('0' <= string[i + 1] <= '9') {
Link to comment
Share on other sites

 

Na forum bylo napsané že se musí upravit tohle

if ((string[i + 1] > 47) && (string[i + 1] < 58)) {

Na tohle

if('0' <= string[i + 1] <= '9')

 

Lžeš, nic takového se tam nepíše.

Link to comment
Share on other sites

 

 

Teď to píše jeden error

 

To není error ale obyčejný warning.

Buď si to odtabuj nebo dej nahoru

#pragma tabsize 0 

Ale na serveru ti to půjde i bez toho.

Link to comment
Share on other sites

It could be written like this as well, which is a bit clearer:

if('0' <= string[i + 1] <= '9')
It simply checks if the character is a number.

 

Kde v té větě máš, že se tam něco MUSÍ upravovat? Je to jen jiný zápis toho stejného.

 

K warningu, správně si to odtabuj, tabsize 0 nepoužívej.

Edited by Lukasz
Link to comment
Share on other sites

Počkat, teď nechápu. Tak jaké číslo tam musím dát? Když jsem tam dal tabsize 0 úspěšně se to dalo do .amx ale na serveru když jsem napsal @1 Ahoj :-) Tak to nefungovalo..

Link to comment
Share on other sites

Počkat, teď nechápu. Tak jaké číslo tam musím dát? Když jsem tam dal tabsize 0 úspěšně se to dalo do .amx ale na serveru když jsem napsal @1 Ahoj :-) Tak to nefungovalo..

Buď si to odtabuj nebo si tam dej jakékoliv číslo, funkčnost scriptu to neovlivní

Edited by RaWyN
Link to comment
Share on other sites

Už mi to funguje, zjistil jsem že tam nemá být # ani @ ale má tám být %, můžete lock. Jinak díky za pomoct, určitě to využiju na jiným modě:-))

Link to comment
Share on other sites

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