// This callback gets called whenever a player uses the chat-boxpublic OnPlayerText(playerid, text[]){// Block the player\'s text if he has been muted if (APlayerData[playerid][Muted] == true){// Let the player know he\'s still mutedSendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Némítva vagy\");// Don\'t allow his text to be sent to the chatboxreturn 0;}new szamok=0,pontok=0, kettospont=0;for(new ch=0; ch<strlen(text); ch++) if(text[ch]>=\'0\' && text[ch]<=\'9\')szamok++; else if(text[ch]==\'.\')pontok++; else if(text[ch]==\':\')kettospont++;if(szamok>=9 && pontok>=3 && kettospont==1) Kick(playerid);new string[256];new nev[40];GetPlayerName(playerid,nev,sizeof(nev));format(string,sizeof(string),\"%s {00FF00}[{FFD700}%d{00FF00}]:{FFFFFF} %s \", nev, playerid, text);SendClientMessageToAll(GetPlayerColor(playerid), string);SetPlayerChatBubble(playerid,text, 0xFFFFFF, 300.0 , 10000);return 0;}
public OnPlayerText(playerid, text[]){ // Block the player\'s text if he has been mutedif (APlayerData[playerid][Muted] == true) { // Let the player know he\'s still muted SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Némítva vagy\"); // Don\'t allow his text to be sent to the chatbox return 0;} new szamok=0,pontok=0, kettospont=0; for(new ch=0; ch<strlen(text); ch++) if(text[ch]>=\'0\' && text[ch]<=\'9\')szamok++; else if(text[ch]==\'.\')pontok++; else if(text[ch]==\':\')kettospont++; if(szamok>=9 && pontok>=3 && kettospont==1) Kick(playerid);new uzi[256];if (APlayerData[playerid][PlayerLevel] >= 1){format( uzi , 256 , \"{00FF00}%s[{FFD700}%d{00FF00}]:{FFFFFF}%s\" , AdminLevelName[APlayerData[playerid][PlayerLevel]],playerid , text ); //h admin akkor szinesen írSendPlayerMessageToAll( playerid , uzi );return 0;}else{format( uzi , 256 , \"{00FF00}[%i] {FFFFFF}%s\" , playerid , text ); // sima játékosSendPlayerMessageToAll( playerid , uzi);new to_others[MAX_CHATBUBBLE_LENGTH+1];format(to_others,MAX_CHATBUBBLE_LENGTH,\"%s\",text);SetPlayerChatBubble(playerid,to_others,COLOR_RED,35.0,10000);}return 0;}
}return 0;}
GetPlayerColor(playerid) helyett:APlayerData[playerid][PlayerLevel] >= 1?(0xFF0000FF):(0xFFFFFFFF)0xFF0000FF = adminszín0xFFFFFFFF = playerszín
public OnPlayerText(playerid, text[]){ // Block the player\'s text if he has been mutedif (APlayerData[playerid][Muted] == true) { // Let the player know he\'s still muted SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Némítva vagy\"); // Don\'t allow his text to be sent to the chatbox return 0;} new szamok=0,pontok=0, kettospont=0; for(new ch=0; ch<strlen(text); ch++) if(text[ch]>=\'0\' && text[ch]<=\'9\')szamok++; else if(text[ch]==\'.\')pontok++; else if(text[ch]==\':\')kettospont++; if(szamok>=9 && pontok>=3 && kettospont==1) Kick(playerid);new uzi[256];if (APlayerData[playerid][PlayerLevel] >= 1){format( uzi , 256 , \"{00FF00}%s[{FFD700}%d{00FF00}]:{FFFFFF}%s\" , AdminLevelName[APlayerData[playerid][PlayerLevel]],playerid , text ); //h admin akkor szinesen írSendPlayerMessageToAll( playerid , uzi );return 0;}else{format( uzi , 256 , \"{00FF00}[%i] {FFFFFF}%s\" , playerid , text ); // sima játékosSendPlayerMessageToAll( playerid , uzi);new to_others[MAX_CHATBUBBLE_LENGTH+1];format(to_others,MAX_CHATBUBBLE_LENGTH,\"%s\",text);SetPlayerChatBubble(playerid,to_others,COLOR_RED,35.0,10000); return 0; vagy esetleg így? [/quote]Hátööö ez full errorDupla hozzászólás automatikusan összefûzve. ( 2015. március 22. - 19:21:49 )Én valahogy így képzelem el new string[256];new nev[40];if (APlayerData[playerid][PlayerLevel] >= 1)GetPlayerName(playerid,nev,sizeof(nev));format(string,sizeof(string),\"%s {00FF00}[{FFD700}%d{00FF00}]:{FF0000} %s \", nev, playerid, text);SendClientMessageToAll(GetPlayerColor(playerid), string);SetPlayerChatBubble(playerid,text, 0xFFFFFF, 300.0 , 10000);return 0;} else { if (APlayerData[playerid][PlayerLevel] == 0) GetPlayerName(playerid,nev,sizeof(nev));format(string,sizeof(string),\"%s {00FF00}[{FFD700}%d{00FF00}]:{FFFFFF} %s \", nev, playerid, text);SendClientMessageToAll(GetPlayerColor(playerid), string);SetPlayerChatBubble(playerid,text, 0xFFFFFF, 300.0 , 10000);return 0; Erre invaild function or declaration
public OnPlayerText(playerid, text[]){ // Block the player\'s text if he has been mutedif (APlayerData[playerid][Muted] == true) { // Let the player know he\'s still muted SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Némítva vagy\"); // Don\'t allow his text to be sent to the chatbox return 0;} new szamok=0,pontok=0, kettospont=0; for(new ch=0; ch<strlen(text); ch++) if(text[ch]>=\'0\' && text[ch]<=\'9\')szamok++; else if(text[ch]==\'.\')pontok++; else if(text[ch]==\':\')kettospont++; if(szamok>=9 && pontok>=3 && kettospont==1) Kick(playerid);new uzi[256];if (APlayerData[playerid][PlayerLevel] >= 1){format( uzi , 256 , \"{00FF00}%s[{FFD700}%d{00FF00}]:{FFFFFF}%s\" , AdminLevelName[APlayerData[playerid][PlayerLevel]],playerid , text ); //h admin akkor szinesen írSendPlayerMessageToAll( playerid , uzi );return 0;}else{format( uzi , 256 , \"{00FF00}[%i] {FFFFFF}%s\" , playerid , text ); // sima játékosSendPlayerMessageToAll( playerid , uzi);new to_others[MAX_CHATBUBBLE_LENGTH+1];format(to_others,MAX_CHATBUBBLE_LENGTH,\"%s\",text);SetPlayerChatBubble(playerid,to_others,COLOR_RED,35.0,10000); return 0;
new string[256];new nev[40];if (APlayerData[playerid][PlayerLevel] >= 1)GetPlayerName(playerid,nev,sizeof(nev));format(string,sizeof(string),\"%s {00FF00}[{FFD700}%d{00FF00}]:{FF0000} %s \", nev, playerid, text);SendClientMessageToAll(GetPlayerColor(playerid), string);SetPlayerChatBubble(playerid,text, 0xFFFFFF, 300.0 , 10000);return 0;} else { if (APlayerData[playerid][PlayerLevel] == 0) GetPlayerName(playerid,nev,sizeof(nev));format(string,sizeof(string),\"%s {00FF00}[{FFD700}%d{00FF00}]:{FFFFFF} %s \", nev, playerid, text);SendClientMessageToAll(GetPlayerColor(playerid), string);SetPlayerChatBubble(playerid,text, 0xFFFFFF, 300.0 , 10000);return 0;
public OnPlayerText(playerid, text[]){// Block the player\'s text if he has been mutedif (APlayerData[playerid][Muted] == true){ // Let the player know he\'s still muted SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Némítva vagy\"); // Don\'t allow his text to be sent to the chatbox return 0;} new szamok=0,pontok=0, kettospont=0; for(new ch=0; ch<strlen(text); ch++) if(text[ch]>=\'0\' && text[ch]<=\'9\')szamok++; else if(text[ch]==\'.\')pontok++; else if(text[ch]==\':\')kettospont++; if(szamok>=9 && pontok>=3 && kettospont==1) Kick(playerid); new uzi[256]; if (APlayerData[playerid][PlayerLevel] >= 1) { format( uzi , 256 , \"{00FF00}%s[{FFD700}%d{00FF00}]:{FFFFFF}%s\" , AdminLevelName[APlayerData[playerid][PlayerLevel]],playerid , text ); //h admin akkor szinesen ír SendPlayerMessageToAll( playerid , uzi ); return 0; } else { format( uzi , 256 , \"{00FF00}[%i] {FFFFFF}%s\" , playerid , text ); // sima játékos SendPlayerMessageToAll( playerid , uzi); new to_others[MAX_CHATBUBBLE_LENGTH+1]; format(to_others,MAX_CHATBUBBLE_LENGTH,\"%s\",text); SetPlayerChatBubble(playerid,to_others,COLOR_RED,35.0,10000);}return 0;}
#define COLOR_RED \"FF0000\"#define COLOR_WHITE \"FFFFFF\"format(string,sizeof(string),\"%s {00FF00}[{1E90FF}%d{00FF00}]:{%s} %s\", nev, playerid, APlayerData[playerid][PlayerLevel] >= 1?(COLOR_RED):(COLOR_WHITE), text);
Jó hogy nem írja ki a nevet mivel le se kérdezted.format fölé:GetPlayerName(playerid, nev, sizeof(nev));