25.02.2015, 10:29
у меня проблема, я пишу в чат а он выводит пустое сообщение, в чем ошибка?
public OnPlayerText(playerid, text[]) { if((GetTickCount() - GetPVarInt(playerid,"Flood_Text")) <= 2000 && GetPVarInt(playerid,"Level") < 1)//[KrYpToDeN] { SetPVarInt(playerid,"FlooderIntoChat",GetPVarInt(playerid,"FlooderIntoChat")+1); if(GetPVarInt(playerid,"FlooderIntoChat") > 10) return BanEx(playerid,"Flooder_Into_Chat"); return SendClientMessage(playerid,-1,"Âû ìîæåòå ïèñàòü ñîîáùåíèÿ â ÷àò íå ÷àùå,÷åì ðàç â 2 ñåêóíäû!")?0:0; } SetPVarInt(playerid,"Flood_Text",GetTickCount()); SetPVarInt(playerid,"FlooderIntoChat",0); if(pStats[playerid][pLogged] == 0) { SendClientMessage(playerid, 0xF6F600AA, "{FEFEC5}† WorldSampGame †{0099CC} Ââåäèòå ñâîé ïàðîëü"); return false; } if(text[0] == '!') { new str[256], name[24], Float:P[3]; GetPlayerName(playerid,name,24); GetPlayerPos(playerid,P[0],P[1],P[2]); format(str,256,"Ìåñòíûé ÷àò: %s (ID:%d): {AFAFAF}%s",name,playerid,text[1]); SetPlayerChatBubble(playerid, text, COLOR_PINK, 100.0, 10000); for(new i = GetMaxPlayers()-1; i != -1; --i) { if(!IsPlayerConnected(i) || !IsPlayerInRangeOfPoint(i,30.0,P[0],P[1],P[2])) continue; SendClientMessage(i,0xFFFFFFAA,str); SetPlayerChatBubble(playerid, text, COLOR_PINK, 100.0, 10000); continue; } return false; } if(Mute[playerid] == 1) { SendClientMessage(playerid, 0xF60000AA, "Òû íå ìîæåøü ãîâîðèòü, òåáå äàëè áàí ÷àòà"); return false; } if(IsMessageSent[playerid] == 1) { SendClientMessage(playerid,admin2, "[ Àíòè-ôëóä ] Ñîîáùåíèÿ ìîæíî ïèñàòü 1 ðàç â 3 ñåêóíäû"); return false; } else { IsMessageSent[playerid] = 1; SetTimerEx("UnMutedX",interval*1000,0,"d",playerid);} UpperToLower(text); new count; for (new i; i < strlen(text); i++) { if (text[i] >= '0' && text[i] <= '9') { count++; if(count == 4) { SendClientMessage(playerid, admin2,"'  âàøåì ñîîáùåíèè ñëèøêîì ìíîãî öèôð, ñîîáùåíèå íå îòïðàâëåíî '"); format(GlobalInfo, sizeof(GlobalInfo), "```'%s'[%d] õîòåë íàïèñàòü â ÷àò (%s)", PlayerEx[playerid][pNameEx],playerid, text); ABroadCast(COLOR_LIGHTRED,GlobalInfo, 1); return false; } } } for(new s = 0; s < num_words; s++) { new pos; while((pos = strfind(text,Swears[s],true)) != -1) for(new i = pos, j = pos + strlen(Swears[s]); i < j; i++){ text[i] = '*'; } } new string[256]; if(PGang[playerid] > 0) { GetPlayerColor(playerid); format(string, sizeof(string), "Áàíäà: %s - %s{00FD00}[ID: %d]{FFFFFF}: %s",GName[PGang[playerid]], PlayerName(playerid), playerid, text); SendClientMessageToAll(GetPlayerColor(playerid), string); return false; } switch(pStats[playerid][ChatColor]) { case 0: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 1: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 2: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 3: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 4: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 5: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 6: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 7: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 8: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 9: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 10: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 11: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 12: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 13: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 14: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 15: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 16: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 17: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 18: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 19: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 20: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 21: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 22: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 23: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 24: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 25: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 26: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 27: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 28: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 29: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 30: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 31: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 32: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 33: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 34: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 35: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 36: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 37: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 38: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } case 39: { format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string); } } /*format(string, sizeof(string), "%s(%d): {FFFFFF}%s", PlayerEx[playerid][pNameEx], playerid, message); SendClientMessageToAll(GetPlayerColor(playerid), string);*/ return 0; }
switch (pStats[playerid][ChatColor])
{
case 0:
{
format(string, sizeof(string), "%s(%d): {FFFAFA}%s", PlayerEx[playerid][pNameEx], playerid, message);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
}
pawn Код:
И вообще где объявление переменной message? Если объявлена глобально, то тогда зачем она тут, не ясно) |