Jump to content
  • 0

pomoc [Errory] PMky


lamka12345

Dotaz

Takze tady sou řádky

 

dcmd_pm(playerid,params[])

{

new recieverid[MAX_PLAYERS];

if(GetConfig("LockPM")==1 || LockPrivm==1) return SendClientMessage(playerid,RED,"Soukromé zprávy jsou zablokovány"),0;

if(Info[playerid][Muted]==1 && GetConfig("MutePM")==1) return SendClientMessage(playerid,RED,"Jsi umlčen !"),0;

--> if(Ignore[recieverid][playerid]==1) return SendClientMessage(playerid,RED,"Tento hráč ignoruje příchozí PMky"),0;

if(GetPVarInt(playerid,"NoPM") == 1) return SendClientMessage(playerid,RED,"Tento hráč ignoruje příchozí PMky");

new string[128];

format(string,sizeof(string),"PM od %s(%d): %s",Name(playerid),playerid,params);

--> SendClientMessage(recieverid,PMCOLOR,string);

--> format(string,sizeof(string),"PM poslána hráči %s: %s",Name(recieverid),params);

SendClientMessage(playerid,PMCOLOR,string);

if(GetConfig("ReadPM")==1)

{

--> format(string,sizeof(string),"\r\n[PM-READER] Hráč %s napsal hráči %s PMku: %s",Name(playerid),Name(recieverid),params);

new cmdstr[80];

new File:log = fopen("Logy/PMka.log",io_append); //Otevreni logu (souboru)

if(log) //Kontrola otevreni souboru

{

fwrite(log,cmdstr); //Zapsani promene

fclose(log); //Uzavreni souboru

}

for(new i=0; i

{

--> if(IsPlayerConnected(i) && IsPlayerAdmin(i) && i != playerid && i != recieverid)

{

SendClientMessage(i,GREEN,string);

}

}

}

return 1;

}

 

dcmd_re(playerid,params[])

{

new recieverid[MAX_PLAYERS];

if(strlen(params) == 0) return SendClientMessage(playerid,0xF2A337FF,"Správně: /re [Text]");

if(GetPVarInt(playerid,"LastID") == -1) return SendClientMessage(playerid,RED,"Žádné předchozí ID !");

if(GetPVarInt(GetPVarInt(playerid,"LastID"),"NoPM") == 1) return SendClientMessage(playerid,RED,"Tento hráč ignoruje příchozí PMky");

new string[128];

format(string,sizeof(string),"PM od %s(%d): %s",Name(playerid),playerid,params);

--> SendClientMessage(recieverid,PMCOLOR,string);

--> format(string,sizeof(string),"PM poslána hráči %s: %s",Name(recieverid),params);

SendClientMessage(playerid,PMCOLOR,string);

if(GetConfig("ReadPM")==1)

{

--> format(string,sizeof(string),"\r\n[PM-READER] Hráč %s napsal hráči %s PMku: %s",Name(playerid),Name(recieverid),params);

new cmdstr[80];

new File:log = fopen("Logy/PMka.log",io_append); //Otevreni logu (souboru)

if(log) //Kontrola otevreni souboru

{

fwrite(log,cmdstr); //Zapsani promene

fclose(log); //Uzavreni souboru

}

for(new i=0; i

{

--> if(IsPlayerConnected(i) && IsPlayerAdmin(i) && i != playerid && i != recieverid)

{

SendClientMessage(i,GREEN,string);

}

}

}

SetPVarInt(GetPVarInt(playerid,"LastID"),"LastID",playerid);

return 1;

}

 

 

a tady chyby

 

 

ERRORY:

 

...(6069) : error 033: array must be indexed (variable "recieverid")

...(6073) : error 035: argument type mismatch (argument 1)

...(6074) : error 035: argument type mismatch (argument 1)

...(6078) : error 035: argument type mismatch (argument 1)

...(6088) : error 033: array must be indexed (variable "recieverid")

...(6105) : error 035: argument type mismatch (argument 1)

...(6106) : error 035: argument type mismatch (argument 1)

...(6110) : error 035: argument type mismatch (argument 1)

...(6120) : error 033: array must be indexed (variable "recieverid")

 

 

Díky za odpovědi :)

 

EDIT: Chybné řádky jsou označené -->

Link to comment
Share on other sites

3 odpovědí na tuto otázku

Recommended Posts

  • 0

No tak za 1. ako zistíš komu posiela správu ?

Za 2. zmeň new recieverid[MAX_PLAYERS]; na new recieverid;

Za 3. použi sscanf na zisťovanie parametrov ( je to účinnejšie ):

new recieverid,StrPM[75];
if(sscanf(params,"us",recieverid,StrPM))return SCM(playerid,FARBA,"Použitie /pm ID Správa !"); // Includ si vyhladaj v googli

Link to comment
Share on other sites

  • 0

Áno chýba ti tam niečo...

ty si síce vytvoríš premennu ale nikde neudávaš čomu sa má rovnať !

 

new recieverid; // vytvoríš a má hodnotu 0

 

Ale ak použiješ sscanf tak ako som už hore písal tak to máš vyriešené "king"

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...