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

Wysłany: 2012-08-25, 11:06


Rumun







Wiek: 30
Na forum: 5235 dni
Posty: 316
Nick w MP: Rumun

Piwa: 25

Respekt: 69

M?g?by mi kto? zmieni? to na ZCMD.Za pomoc daje piwko. ;) Je?eli kto? znajdzie w zcmd te komendy mo?e je tutaj doda?.


Kod:

if(strcmp(cmd, "/mute", true) == 0) {
if(Admin[playerid] || IsPlayerAdmin(playerid)) {
tmp = strtok(cmdtext, idx);

if(!strlen(tmp)) {
SendClientMessage(playerid, CADMIN, "Wpisz: /mute [id] [pow?d]");
return 1;
}
giveplayerid = strval(tmp);

strmid(tmp, cmdtext, 5+strlen(tmp), strlen(cmdtext));
if(!strlen(tmp)) {
SendClientMessage(playerid, CADMIN, "Wpisz: /mute [id] [pow?d]");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string),"Gracz %s zosta? uciszony przez Admina %s. Pow?d: %s.",giveplayer,sendername,tmp);
SendClientMessageToAll(COLOR_ADMIN,string);
Muted[giveplayerid]=1;

}else{
SendClientMessage(playerid,COLOR_ADMIN,">> Nie jeste? administratorem");
}
return 1;
}



Kod:

if(strcmp(cmd, "/unmute", true) == 0) {
if(Admin[playerid] || IsPlayerAdmin(playerid)) {
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
if(!strlen(tmp)) {
SendClientMessage(playerid, CADMIN, "Wpisz: /unmute [playerid]");
return 1;
}

if (IsPlayerConnected(giveplayerid)) {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
Muted[giveplayerid] = 0;

format(string, sizeof(string), "%s (id: %d) zostal odciszony przez Admina %s (id:%d)", giveplayer,giveplayerid,PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_ADMIN, string);
} else {
new stringY[256];
format(stringY, sizeof(stringY), "Z?e ID gracza");
SendClientMessage(playerid, COLOR_ADMIN, stringY);
}
}else{
SendClientMessage(playerid,COLOR_ADMIN,">> Nie jeste? administratorem");
}



Kod:

if(strcmp(cmd, "/report", true)==0){
tmp = strtok(cmdtext, idx);

if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_YELLOW, "U?yj: /report [id gracza] [pow?d]");
return 1;
}
giveplayerid = strval(tmp);

strmid(tmp, cmdtext, 8+strlen(tmp), strlen(cmdtext));
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_YELLOW, "U?yj: /report [id gracza] [pow?d]");
return 1;
}
if (IsPlayerConnected(giveplayerid)) {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
RaportCheater(playerid, giveplayer, tmp);
format(string, sizeof(string), "Zg?osi?e? raport o %s do administracji.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
}
else {
format(string, sizeof(string), "Nieprawid?owe ID!", giveplayerid);
SendClientMessage(playerid, COLOR_ADMIN, string);
}

return 1;
}


Kod:

if(strcmp(cmd, "/wiez", true) == 0 ) {
if(Admin[playerid] || IsPlayerAdmin(playerid)) {
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
if(!strlen(tmp)) {
SendClientMessage(playerid, CADMIN, "Wpisz: /wiez [playerid]");
return 1;
}

if (IsPlayerConnected(giveplayerid)) {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
SetPlayerInterior(giveplayerid,3);
SetPlayerPos(giveplayerid,193.6751,175.0777,1003.023);
JailStatus[giveplayerid] = 1;
Cenzed[giveplayerid] = 1;
format(string, sizeof(string), "%s (id: %d) zostal uwieziony przez Admina %s (id:%d)", giveplayer,giveplayerid,PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_ADMIN, string);
} else {
new stringY[256];
format(stringY, sizeof(stringY), "Z?e ID gracza");
SendClientMessage(playerid, COLOR_ADMIN, stringY);
}
}else{
SendClientMessage(playerid,COLOR_ADMIN,">> Nie jeste? administratorem");
}
return 1;
}



Kod:

if(strcmp(cmd, "/unwiez", true) == 0) {
if(Admin[playerid] == 1 || IsPlayerAdmin(playerid)){
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
if(!strlen(tmp)) {
SendClientMessage(playerid, CADMIN, "Wpisz: /unwiez [playerid]");
return 1;
}

if (IsPlayerConnected(giveplayerid)) {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
SetPlayerInterior(giveplayerid,0);
SetPlayerPos(giveplayerid,2094.2275,1283.2485,10.8203);
JailStatus[giveplayerid] = 0;
Cenzed[giveplayerid] = 0;
format(string, sizeof(string), "%s (id: %d) zostal uwolniony z jaila przez Admina %s (id:%d)", giveplayer,giveplayerid,PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_ADMIN, string);
} else {
new stringY[256];
format(stringY, sizeof(stringY), "Z?e ID gracza");
SendClientMessage(playerid, COLOR_ADMIN, stringY);
}
}else{
SendClientMessage(playerid,COLOR_ADMIN,">> Nie jeste? administratorem");
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-25, 12:47


Bielo99







Wiek: 27
Na forum: 5395 dni
Posty: 15
Nick w MP: Bielo

Piwa: 5

Respekt: 50

Mute:

Kod:


CMD:mute(playerid, params[])
{
new forplayerid,
Powod[128];

if(IsPlayerAdmin(playerid) )
{
if(sscanf(params, "dS(Brak powodu)[64]", forplayerid, Powod))
return SendClientMessage(playerid, LIGHTRED, "* /mute [ID] [Czas] [Pow?d]");
if(!IsPlayerConnected(forplayerid))
return SendClientMessage(playerid, LIGHTRED, "Nie ma gracza o podanym id.");
if(GetPVarInt(forplayerid, "Mute") == 1)
return SendClientMessage(playerid, LIGHTRED, "Gracz jest ju? wyciszony.");
SetPVarInt(forplayerid, "Mute", 1);
format(string, sizeof string, "Gracz %s zosta? wyciszony przez %s. Pow?d: %s", PlayerName(forplayerid), PlayerName(playerid), Powod);
SendClientMessageToAll(LIGHTRED, string);
format(string, sizeof string, "Zosta?e? wyciszony przez administratora %s.", PlayerName(playerid));
SendClientMessage(forplayerid, LIGHTRED, string);
return 1;
}
return 0;
}


UnMute :

Kod:


CMD:unmute(playerid, params[])
{
new forplayerid;

if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "d", forplayerid))
return SendClientMessage(playerid, LIGHTRED, "* /unmute [ID]");
if(!IsPlayerConnected(forplayerid))
return SendClientMessage(playerid, LIGHTRED, "Nie ma gracza o podanym id.");
if(GetPVarInt(forplayerid, "Mute") != 1)
return SendClientMessage(playerid, LIGHTRED, "Gracz nie jest wyciszony.");
DeletePVar(forplayerid, "Mute");
format(string, sizeof string, "Graczowi %s zosta?a przywr?cona mo?liwo?? pisania przez %s.", PlayerName(forplayerid), PlayerName(playerid));
SendClientMessageToAll(LIGHTRED, string);
SendClientMessage(forplayerid, LIGHTRED, "Zosta?a Ci przywr?cona mo?liwo?? pisania");
return 1;
}
return 0;
}


a wiecej nie wiem :p

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-25, 16:46


krzyzan







Wiek: 30
Na forum: 5669 dni
Posty: 387

Piwa: 2132

Respekt: 135
Respekt: 135

Report
Kod:

CMD:report(playerid, params[])
{
new gracz, powod[32];
if(sscanf(params,"rs[32]", gracz,powod)) return SendClientMessage(playerid, -1, "Wpisz: /raport (id) (pow?d)");
if(IsPlayerConnected(gracz))
{
GetPlayerName(gracz, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
//RaportCheater(playerid, giveplayer, tmp);
format(string, sizeof(string), "Zg?osi?e? raport o %s do administracji.", giveplayer);
SendClientMessage(playerid, -1, string);
}
else
{
format(string, sizeof(string), "Nieprawid?owe ID!", gracz);
SendClientMessage(playerid, -1, string);
}

return 1;
}


wiez
Kod:

CMD:wiez(playerid,params[])
{
if(Admin[playerid] || IsPlayerAdmin(playerid)) {
if(isnull(params)) {
SendClientMessage(playerid, -1, "Wpisz: /wiez [playerid]");
return 1;
}
new gracz=strval(params);
if (IsPlayerConnected(gracz)) {
GetPlayerName(gracz, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
SetPlayerInterior(gracz,3);
SetPlayerPos(gracz,193.6751,175.0777,1003.023);
JailStatus[gracz] = 1;
Cenzed[gracz] = 1;
format(string, sizeof(string), "%s (id: %d) zostal uwieziony przez Admina %s (id:%d)", giveplayer,gracz,sendername,playerid);
SendClientMessageToAll(-1, string);
} else {
format(string, sizeof(string), "Z?e ID gracza");
SendClientMessage(playerid, -1, string);
}
}else{
SendClientMessage(playerid,COLOR_ADMIN,">> Nie jeste? administratorem");
}
return 1;
}


unwiez

Kod:

CMD:unwiez(playerid,params[])
{
if(Admin[playerid] == 1 || IsPlayerAdmin(playerid))
{
if(isnull(params))
{
SendClientMessage(playerid, -1, "Wpisz: /unwiez [playerid]");
return 1;
}
new gracz=strval(params);
if(IsPlayerConnected(gracz))
{
GetPlayerName(gracz, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
SetPlayerInterior(gracz,0);
SetPlayerPos(gracz,2094.2275,1283.2485,10.8203);
JailStatus[gracz] = 0;
Cenzed[gracz] = 0;
format(string, sizeof(string), "%s (id: %d) zostal uwolniony z jaila przez Admina %s (id:%d)", giveplayer,gracz,sendername,playerid);
SendClientMessageToAll(-1, string);
}else{
format(string, sizeof(string), "Z?e ID gracza");
SendClientMessage(playerid, -1, string);
}
}else{
SendClientMessage(playerid,-1,">> Nie jeste? administratorem");
}

return 1;
}


Musisz teraz w mapie doda? #include <sscanf>
i u?ywa? na serwerze plugin u sscanf:
http://gtao.pl.com/showthread.php?t=120356

[ Dodano: 2012-08-25, 16:49 ]
Poprawione troch? mute
Kod:


CMD:mute(playerid, params[])
{
new gracz,Powod[64];
if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "rs[64]", gracz, Powod))
return SendClientMessage(playerid, LIGHTRED, "* /mute [ID] [Czas] [Pow?d]");
if(!IsPlayerConnected(gracz))
return SendClientMessage(playerid, LIGHTRED, "Nie ma gracza o podanym id.");
if(GetPVarInt(gracz, "Mute") == 1)
return SendClientMessage(playerid, LIGHTRED, "Gracz jest ju? wyciszony.");
SetPVarInt(gracz, "Mute", 1);
format(string, sizeof string, "Gracz %s zosta? wyciszony przez %s. Pow?d: %s", PlayerName(gracz), PlayerName(playerid), Powod);
SendClientMessageToAll(LIGHTRED, string);
format(string, sizeof string, "Zosta?e? wyciszony przez administratora %s.", PlayerName(playerid));
SendClientMessage(forplayerid, LIGHTRED, string);
}
return 1;
}


i unmute
Kod:

CMD:unmute(playerid, params[])
{
new forplayerid=strval(params);

if(IsPlayerAdmin(playerid))
{
if(isnull(params)) return SendClientMessage(playerid, LIGHTRED, "* /unmute [ID]");
if(!IsPlayerConnected(forplayerid))
return SendClientMessage(playerid, LIGHTRED, "Nie ma gracza o podanym id.");
if(GetPVarInt(forplayerid, "Mute") != 1)
return SendClientMessage(playerid, LIGHTRED, "Gracz nie jest wyciszony.");
DeletePVar(forplayerid, "Mute");
format(string, sizeof string, "Graczowi %s zosta?a przywr?cona mo?liwo?? pisania przez %s.", PlayerName(forplayerid), PlayerName(playerid));
SendClientMessageToAll(LIGHTRED, string);
SendClientMessage(forplayerid, LIGHTRED, "Zosta?a Ci przywr?cona mo?liwo?? pisania");
}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-25, 20:38


Rumun







Wiek: 30
Na forum: 5235 dni
Posty: 316
Nick w MP: Rumun

Piwa: 25

Respekt: 69

Mam takie errory mo?e mi kto? powiedzie? jak je naprawi??

Kod:

C:\Documents and Settings\DCP\Pulpit\new.pwn(4124) : error 017: undefined symbol "string"
C:\Documents and Settings\DCP\Pulpit\new.pwn(4124) : error 017: undefined symbol "string"
C:\Documents and Settings\DCP\Pulpit\new.pwn(4125) : error 017: undefined symbol "string"
C:\Documents and Settings\DCP\Pulpit\new.pwn(4126) : error 017: undefined symbol "string"
C:\Documents and Settings\DCP\Pulpit\new.pwn(4126) : error 017: undefined symbol "string"
C:\Documents and Settings\DCP\Pulpit\new.pwn(4127) : error 017: undefined symbol "forplayerid"


Takie b??dy s? jak dodam do mapki /mute
Za pomoc dam piwko.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-25, 21:01


Raydex







Wiek: 36
Na forum: 6037 dni
Posty: 138

Piwa: 1043

Respekt: 41,7

Daj na g?re mape - new string[256]

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-26, 08:10


Michalec

Dokładnie.






Wiek: 30
Na forum: 6405 dni
Posty: 163
Nick w MP: []Damianos[]

Piwa: 99

Respekt: 86,6

Kod:

CMD:mute(playerid, params[])
{
new gracz,Powod[64],string[128];
if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "rs[64]", gracz, Powod))
return SendClientMessage(playerid, LIGHTRED, "* /mute [ID] [Pow?d]");
if(!IsPlayerConnected(gracz))
return SendClientMessage(playerid, LIGHTRED, "Nie ma gracza o podanym id.");
if(GetPVarInt(gracz, "Mute") == 1)
return SendClientMessage(playerid, LIGHTRED, "Gracz jest ju? wyciszony.");
SetPVarInt(gracz, "Mute", 1);
format(string, sizeof string, "Gracz %s zosta? wyciszony przez %s. Pow?d: %s", PlayerName(gracz), PlayerName(playerid), Powod);
SendClientMessageToAll(LIGHTRED, string);
format(string, sizeof string, "Zosta?e? wyciszony przez administratora %s.", PlayerName(playerid));
SendClientMessage(forplayerid, LIGHTRED, string);
}
return 1;
}


Co to @up. Skandal tak definiowa?...

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-26, 09:21


Rumun







Wiek: 30
Na forum: 5235 dni
Posty: 316
Nick w MP: Rumun

Piwa: 25

Respekt: 69

Zosta? mi tylko 1 error.

Kod:

C:\Documents and Settings\DCP\Pulpit\new.pwn(4126) : error 017: undefined symbol "forplayerid"


Jak dodam to unmute od krzyzana to mam takie errory
Kod:


C:\Documents and Settings\DCP\Pulpit\new.pwn(4127) : error 017: undefined symbol "forplayerid"
C:\Documents and Settings\DCP\Pulpit\new.pwn(4144) : error 017: undefined symbol "string"
C:\Documents and Settings\DCP\Pulpit\new.pwn(4144) : error 017: undefined symbol "string"
C:\Documents and Settings\DCP\Pulpit\new.pwn(4145) : error 017: undefined symbol "string"


Dodanie tego string[256] nic nie daje.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-26, 11:44


krzyzan







Wiek: 30
Na forum: 5669 dni
Posty: 387

Piwa: 2132

Respekt: 135
Respekt: 135

Kod:

CMD:mute(playerid, params[])
{
new gracz,Powod[64],string[256];
if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "rs[64]", gracz, Powod))
return SendClientMessage(playerid, LIGHTRED, "* /mute [ID] [Czas] [Pow?d]");
if(!IsPlayerConnected(gracz))
return SendClientMessage(playerid, LIGHTRED, "Nie ma gracza o podanym id.");
if(GetPVarInt(gracz, "Mute") == 1)
return SendClientMessage(playerid, LIGHTRED, "Gracz jest ju? wyciszony.");
SetPVarInt(gracz, "Mute", 1);
format(string, sizeof string, "Gracz %s zosta? wyciszony przez %s. Pow?d: %s", PlayerName(gracz), PlayerName(playerid), Powod);
SendClientMessageToAll(LIGHTRED, string);
format(string, sizeof string, "Zosta?e? wyciszony przez administratora %s.", PlayerName(playerid));
SendClientMessage(gracz, LIGHTRED, string);
}
return 1;
}


Kod:



CMD:unmute(playerid, params[])
{
new forplayerid=strval(params);
new string[256];
if(IsPlayerAdmin(playerid))
{
if(isnull(params)) return SendClientMessage(playerid, LIGHTRED, "* /unmute [ID]");
if(!IsPlayerConnected(forplayerid))
return SendClientMessage(playerid, LIGHTRED, "Nie ma gracza o podanym id.");
if(GetPVarInt(forplayerid, "Mute") != 1)
return SendClientMessage(playerid, LIGHTRED, "Gracz nie jest wyciszony.");
DeletePVar(forplayerid, "Mute");
format(string, sizeof string, "Graczowi %s zosta?a przywr?cona mo?liwo?? pisania przez %s.", PlayerName(forplayerid), PlayerName(playerid));
SendClientMessageToAll(LIGHTRED, string);
SendClientMessage(forplayerid, LIGHTRED, "Zosta?a Ci przywr?cona mo?liwo?? pisania");
}
return 1;
}


A co do string na samej g?rze to jest dobre rozwi?zanie bo definiujesz tylko 1 string globalnie a nie tworzysz 1500 string?w

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-26, 12:02


Rumun







Wiek: 30
Na forum: 5235 dni
Posty: 316
Nick w MP: Rumun

Piwa: 25

Respekt: 69

Nic nie daje dodanie tego new string[256] jak go dodam to wyskakuje jeszcze wi?cej error?w nie mam jaka jest tego przyczyna.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-26, 12:10


ToxiC.







Wiek: 28
Na forum: 5246 dni
Posty: 3792

Piwa: 8590

Respekt: 1143,8
Respekt: 1143,8

Poka? je

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-26, 14:34


Michalec

Dokładnie.






Wiek: 30
Na forum: 6405 dni
Posty: 163
Nick w MP: []Damianos[]

Piwa: 99

Respekt: 86,6

Kod:

CMD:mute(playerid, params[])
{
new gracz,Powod[64],string[128];
if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "rs[64]", gracz, Powod))
return SendClientMessage(playerid, LIGHTRED, "* /mute [ID] [Pow?d]");
if(!IsPlayerConnected(gracz))
return SendClientMessage(playerid, LIGHTRED, "Nie ma gracza o podanym id.");
if(GetPVarInt(gracz, "Mute") == 1)
return SendClientMessage(playerid, LIGHTRED, "Gracz jest ju? wyciszony.");
SetPVarInt(gracz, "Mute", 1);
format(string, sizeof string, "Gracz %s zosta? wyciszony przez %s. Pow?d: %s", PlayerName(gracz), PlayerName(playerid), Powod);
SendClientMessageToAll(LIGHTRED, string);
format(string, sizeof string, "Zosta?e? wyciszony przez administratora %s.", PlayerName(playerid));
SendClientMessage(gracz, LIGHTRED, string);
}
return 1;
}


Masz i musi dzia?a?.

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-27, 09:26


Rumun







Wiek: 30
Na forum: 5235 dni
Posty: 316
Nick w MP: Rumun

Piwa: 25

Respekt: 69

Dzi?ki panowie dzia?a :) Po piwku i mo?na zamkn??.

Postaw piwo autorowi tego posta
 

 
Tagi: prosba :: strcmp :: zcmd
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] Prosba z strcmp na zcmd 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