Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2013-04-06, 18:44


skype







Wiek: 36
Na forum: 4920 dni
Posty: 38
Nick w MP: eReM

Piwa: 8

Respekt: 50

Witam ot?? mam jeden problem bo gdy pisze /mute id czas pow?d to pisze ze gracz zosta? uciszony ale niestety to nie prawda !! . Prosz? o pomoc !! .



O to kod
Kod:


CMD:mute(playerid, cmdtext[])
{
if(!Administrator[playerid] && !Moderator[playerid]) return SendClientMessage(playerid,C_RED2,"||Nie jeste? Administrator'em||");

new id, mczas, powod[60];
if(sscanf(cmdtext, "uds[60]", id, mczas, powod)) return SCM(playerid, "U?yj: /mmute <id gracza> <czas> <pow?d>");

if(id == playerid) return SCM(playerid, "* Nie mo?esz uciszy? samego siebie!");
if(!IsPlayerConnected(id)) return SCM(playerid, "* Ten gracz nie jest pod??czony!");
if(mczas < 1) return SCM(playerid, "* Nieprawid?owy czas.");
if(strlen(powod) < 1 || strlen(powod) > 60) return SCM(playerid, "* Pow?d musi mie? 1-60 znak?w!");

new string2[128];
Mute[id] = mczas;
format(string2, sizeof(string2), "Gracz %s (%d) zosta? uciszony przez moderatora %s (%d). Pow?d: %s", PlayerName(id), id, PlayerName(playerid), playerid, powod);
SendClientMessageToAll(0xFF0000FF, string2);
SetTimerEx("CountMute", 1000, 0, "d", id);
return 1;
}

CMD:unmute(playerid, cmdtext[])
{
if(!Administrator[playerid] && !Moderator[playerid]) return SendClientMessage(playerid,C_RED2,"||Nie jeste? Administrator'em||");

new graczid;
if(sscanf(cmdtext, "u", graczid)) return SCM(playerid, "U?yj: /munmute <id gracza>");

if(!IsPlayerConnected(graczid)) return SCM(playerid, "* Ten gracz nie jest pod??czony!");
if(Mute[graczid] == 0) return SCM(playerid, "* Ten gracz nie jest uciszony!");

new string2[128];
Mute[graczid] = 0;
format(string2, sizeof(string2), "Gracz %s (%d) zosta? odciszony przez Admina/Moda %s (%d).", PlayerName(graczid), graczid, PlayerName(playerid), playerid);
SendClientMessageToAll(0xFF0000FF, string2);
CountMute(graczid);
return 1;
}

forward CountMute(playerid);
public CountMute(playerid)
{
if(Mute[playerid] > 0)
{
new mstr[50];
format(mstr, sizeof(mstr), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~Uciszony przez: %d", Mute[playerid]);
GameTextForPlayer(playerid, mstr, 2000, 3);
Mute[playerid]--;
return 1;
}

Mute[playerid] = false;
KillTimer(MuteTimer[playerid]);
SendClientMessage(playerid,C_GREEN,"»» |Mute| Ju? mo?esz pisa? na czacie !! .");
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-06, 18:55


KatieM







Wiek: 32
Na forum: 4868 dni
Posty: 82
Nick w MP: _DMCy

Piwa: 293

Respekt: 85

Ostrzeżeń: 20%
Dziwne masz te "mute".

Kod:

enum PInfo {
Mute
} new Player[MAX_PLAYERS][PInfo];


Komenda:

Kod:

CMD:mute(playerid, params[]) {

if(!IsAdmin(playerid))
return clientMsg(playerid, WRONG_MSG, " |b??d| :: Komenda dost?pna tylko dla administratora.");

new PlayerId, Seconds;

if(sscanf(params, "ud", PlayerId, Seconds))
return clientMsg(playerid, WRONG_MSG, " |b??d| :: U?yj: /mute [id gracza] [liczba sekund]");

if(PlayerId == INVALID_PLAYER_ID)
return clientMsg(playerid, WRONG_MSG, " |b??d| :: Nie ma gracza o podanym ID.");

Player[PlayerId][Mute] = Seconds;

new String[255];

format(String, sizeof(String), " |info| :: Gracz %s (id %d) zosta? uciszony przez administratora %s (id %d) na %d sek.", GetPlayerNick(PlayerId), PlayerId, GetPlayerNick(playerid), playerid, Seconds);
publicMsg(COLOR_ORANGE, String);
return 1;
}

CMD:unmute(playerid, params[]) {

if(!IsAdmin(playerid))
return clientMsg(playerid, WRONG_MSG, " |b??d| :: Komenda dost?pna tylko dla administratora.");

new PlayerId;
if(sscanf(params, "u", PlayerId))
return clientMsg(playerid, WRONG_MSG, " |b??d| :: U?yj: /unmute [id gracza]");

if(PlayerId == INVALID_PLAYER_ID)
return clientMsg(playerid, WRONG_MSG, " |b??d| :: Nie ma gracza o podanym ID.");

Player[PlayerId][Mute] = 0;

new String[255];

format(String, sizeof(String), " |info| :: Gracz %s (%d) zosta? odciszony.", GetPlayerNick(PlayerId), PlayerId);
publicMsg(CORRECT_MSG, String);
return 1;
}


ustaw gdy gracz wchodzi na serwer:
Kod:

Player[playerid][Mute] = 0


Je?eli masz jaki? timer powtarzaj?cy si? co sekunde to daj w nim:

Kod:

--Player[playerid][Mute];


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-06, 18:55


Quis

Wszechwiedzący






Wiek: 31
Na forum: 5146 dni
Posty: 464
Nick w MP: Quis

Piwa: 1110

Respekt: 325
Respekt: 325Respekt: 325Respekt: 325

skype, uciszonemu wy?wietla si? GameText? I poka? public OnPlayerText, bo tam si? blokuje pisanie na czacie.

@UP
By?e? pierwszy, ale po jakiego wysy?asz mu zupe?nie inny kod, jak on chce ?eby mu jego naprawi?. Do tego nie da?e? mu funkcji clientMsg, publicMsg - on tego nie ma.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-07, 00:03


Seboo







Wiek: 30
Na forum: 5515 dni
Posty: 124
Nick w MP: Sebo

Piwa: 1228

Respekt: 102
Respekt: 102

Kod:

public OnPlayerText(playerid, text[])
{
if(Mute[playerid] == true)
{
SCM(playerid, -1, "Jeste? wyciszony.");
return 0;
}

//dalszy kod


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-07, 00:20


Quis

Wszechwiedzący






Wiek: 31
Na forum: 5146 dni
Posty: 464
Nick w MP: Quis

Piwa: 1110

Respekt: 325
Respekt: 325Respekt: 325Respekt: 325

Zmie? na:
Kod:

if(Mute[playerid] > 0)


true to odpowiednik 1. A tam masz czas w sekundach.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-07, 08:16


KatieM







Wiek: 32
Na forum: 4868 dni
Posty: 82
Nick w MP: _DMCy

Piwa: 293

Respekt: 85

Ostrzeżeń: 20%
Quis, bo wed?ug mnie ta jego komenda jest "brudno" napisana. Widze ?e pomog?e? ju? wi?c... ;)

Postaw piwo autorowi tego posta
 

 
Tagi: mute
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN » [INNE] Mute Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku