Jump to content
  • 0

pomoc PROBLEM S ID


Fikkki

Dotaz

Zdarec mam id posilam treba pm na id 1 a posle se to treba id 5 a nebo dam ban nekomu jinemu nez koho sem zadal v id jak je to mozne poradte uz me to docela sere protoze dycky poslu pm treba nekomu jinemu nez zadam.

Link to comment
Share on other sites

18 odpovědí na tuto otázku

Recommended Posts

  • 0

protoze kdyz pises za prikaz delsi text nez 50 znaku tak ti strval vyplivne spatne id je.

drive na 02x ti to deparalizovalo mod tet to jen vyhodi spatne id

musis ti treba prvni 3 znaky uriznout a dat do strvalu jen ty 3 a ne vic jak 50

Link to comment
Share on other sites

  • 0

dcmd_pm(playerid,params[])
{
new id = strval(params);
blablabla
}

 

takto to mas ze ?

 

tak si to takto orizni

 

dcmd_pm(playerid,params[])
{
new p[3];
format(p,3,params);
new id = strval(p);
tady to odriznuti id od textu atd..
bla bla bla
}

Link to comment
Share on other sites

  • 0

hele nejak sem to nepochopil takhle mam prikaz nepredelal bys mi ho prosim? ale tohle me blbne i u prikazu ban ze dam ban jinymu id nez zadam

dcmd_pm(playerid, params[])
{
   if (IsPlayerConnected(playerid))
  {
     new pos;
      if (!params[0] || !(pos = chrfind(' ', params) + 1) || !params[pos]) return SendClientMessage(playerid, B_CERV, "Použití: /pm [iD] [TEXT]");
      new id = strval(params), string[300];
      if (strlen(params) > 100)           return SendClientMessage(playerid, B_ZLUT, "Zpráva může mít maximálně 100 symbolů!");
      if (id == playerid)                 return SendClientMessage(playerid, B_ZLUT, "Nemůžeš poslat soukromou zprávu sám sobě!");
      if (!IsPlayerConnected(id))         return SendClientMessage(playerid, B_ZLUT, "Toto id není připojené!");

     format(string, sizeof(string), "PM pro %s [%d]: %s", Jmeno(id), id, params[pos]);
     SendClientMessage(playerid, 0x99FF00AA, string);

     format(string, sizeof(string), "PM od %s [%d]: %s", Jmeno(playerid), playerid, params[pos]);
     SendClientMessage(id, 0x99FF00AA, string);

     PlayerPlaySound(id, 1085, 0.0, 0.0, 0.0);
     printf("PM: %s", string);
  }
  return 1;
}

Link to comment
Share on other sites

  • 0

dej si do módu stock sscanf a nemusíš si dělat starosti s params, používá se takto:

 

dcmd_pm(playerid, params[])
{
  if(IsPlayerConnected(playerid))
  {
     new id,string[256];
     if(sscanf(params,"us",id,string)) return SendClientMessage(playerid, B_CERV, "Použití: /pm [iD] [TEXT]"); // u = playerid, s = string
     SendClientMesdsage(id,barva,string); // atd ...
  }
  return 1;
}

Link to comment
Share on other sites

  • 0
vubec nevim co myslsi ale ja bych potreboval videt ten celej prikaz udelanej ja to vubec nepobral

 

vždyt jsem ti ho celej napsal, to základní tam máš, podívej se na ukázky příkazů na wiki ...

Link to comment
Share on other sites

  • 0

mysliš toto ?

 

dcmd_pm(playerid, params[])
{
  if(IsPlayerConnected(playerid))
  {
     new id,string[256];
     if(sscanf(params,"us",id,string)) return SendClientMessage(playerid, B_CERV, "Použití: /pm [iD] [TEXT]"); // u = playerid, s = string
     SendClientMesdsage(id,barva,string); // atd ...
  }
  return 1;
}

 

to je cele?

Link to comment
Share on other sites

  • 0
mysliš toto ?

 

dcmd_pm(playerid, params[])
{
  if(IsPlayerConnected(playerid))
  {
     new id,string[256];
     if(sscanf(params,"us",id,string)) return SendClientMessage(playerid, B_CERV, "Použití: /pm [iD] [TEXT]"); // u = playerid, s = string
     SendClientMesdsage(id,barva,string); // atd ...
  }
  return 1;
}

 

to je cele?

 

a co čekáš ? ty ostatní věci v příkazu si snad doplníš, vždyt je tam u sebe máš

Link to comment
Share on other sites

  • 0

ale tenhle stock uz tam davno mam

 

-- ned 11. črc 2010 13:23:45 --

 

prosimtě mužeš mě napsat jak ten cely prikaz ma vypadat toto je do nekonecna prosim napis me ho

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...