03.08.2012, 21:53
Hello everyone! I have this problem: When I say something in the chatbox the server crashes. He does this only on the host, playing locally does not. Thanks for the help! I do not know what to do!
public OnPlayerText(playerid, text[]) { new string[256]; new tmp[256]; new sendername[MAX_PLAYER_NAME]; if(strcmp(text, "sa", true) == 0) { format(string, sizeof(string), "%s saluta con una stretta di mano e un abbraccio.", GetPlayerNameEx(playerid)); ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerChatBubble(playerid, text, COLOR_WHITE, 30.0, 7000); ApplyAnimation(playerid,"GANGS","hndshkfa_swt",4.0,0,0,0,0,0); //shake return 0; } if(strcmp(text, "haha", true) == 0) { format(string, sizeof(string), "%s ride di gusto.", GetPlayerNameEx(playerid)); ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerChatBubble(playerid, text, COLOR_WHITE, 30.0, 7000); ApplyAnimation(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0); // Laugh return 0; } if(strcmp(text, "omg", true) == 0) { format(string, sizeof(string), "%s urla: Oh Mio Dio!!!", GetPlayerNameEx(playerid)); ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,1,0,0,1,1); SetTimerEx("ChatTimer", 1000, false, "i", playerid); ProxDetector(20.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW); SetPlayerChatBubble(playerid, text, COLOR_WHITE, 30.0, 7000); return 0; } if(strcmp(text, "cc", true) == 0) { format(string, sizeof(string), "%s urla: Che Cazzo?!?!", GetPlayerNameEx(playerid)); ProxDetector(20.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW); SetPlayerChatBubble(playerid, text, COLOR_WHITE, 30.0, 7000); ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,1,0,0,1,1); SetTimerEx("ChatTimer", 1000, false, "i", playerid); return 0; } if(strcmp(text, "lol", true) == 0) { format(string, sizeof(string), "%s ride ad alta voce.", GetPlayerNameEx(playerid)); ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerChatBubble(playerid, text, COLOR_WHITE, 30.0, 7000); ApplyAnimation(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0); // Laugh return 0; } if(strcmp(text, ":)", true) == 0) { format(string, sizeof(string), "%s sorride.", GetPlayerNameEx(playerid)); ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerChatBubble(playerid, text, COLOR_WHITE, 30.0, 7000); return 0; } if(strcmp(text, ":(", true) == 0) { format(string, sizeof(string), "%s si rattrista.", GetPlayerNameEx(playerid)); ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerChatBubble(playerid, text, COLOR_WHITE, 30.0, 7000); return 0; } if(strcmp(text, ":'(", true) == 0) { format(string, sizeof(string), "%s si mette a piangere.", GetPlayerNameEx(playerid)); ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerChatBubble(playerid, text, COLOR_WHITE, 30.0, 7000); return 0; } if(strcmp(text, ":D", true) == 0) { format(string, sizeof(string), "%s scoppia a ridere.", GetPlayerNameEx(playerid)); ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerChatBubble(playerid, text, COLOR_WHITE, 30.0, 7000); ApplyAnimation(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0); // Laugh return 0; } if(strcmp(text, "з_з", true) == 0) { format(string, sizeof(string), "%s piange disperatamente.", GetPlayerNameEx(playerid)); ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SetPlayerChatBubble(playerid, text, COLOR_WHITE, 30.0, 7000); return 0; } if(strcmp(text, "AccostaP", true) == 0) { if(PlayerInfo[playerid][pFaction] !=0 ) format(string, sizeof(string), "[Megafono:] %s Urla: Polizia di Gold City,accosti immediatamente!", GetPlayerNameEx(playerid)); ProxDetector(20.0, playerid, string,COLOR_ORANGE,COLOR_ORANGE,COLOR_ORANGE,COLOR_ORANGE,COLOR_ORANGE); SetPlayerChatBubble(playerid, text, COLOR_ORANGE, 30.0, 7000); return 0; } if(!strfind(text,"hai dei semi?",true)) { format(string,sizeof(string),"{FF0000}%s: {FFFFFF}Hai dei semi?", GetPlayerNameEx(playerid)); SendClientMessage(playerid, 0xFFFFFFAA, string); if(IsPlayerInRangeOfPoint(playerid,3,-2428.5735,2368.4224,5.4437)) { if(GetPlayerCash(playerid) >= 10)//METTI QUELLO PER RILEVARE QUANTI SOLDI HA { if( Semi[playerid] == 0 ) { azione(playerid,"{FF0000}Spacciatore:{FFFFFF} Tieni dei semi, fanne buon uso."); SendClientMessage(playerid, 0xFFFFFFAA, "{FFFF00}[Info:]{FFFFFF} Hai comprato dei semi, usa {FF0000}/pianta{FFFFFF} per piantarli in un luogo RP"); Semi[playerid] = 1; GivePlayerCash(playerid, -10);//METTI QUELLO PER DARGLI SOLDI } else { azione(playerid,"{FF0000}Spacciatore:{FFFFFF} Ti ho giа venduto dei semi, 'mbecille."); } } else { azione(playerid,"{FF0000}Spacciatore:{FFFFFF} Ma vattene poveraccio, e non tornare finchи non avrai soldi."); } } else { SendClientMessage(playerid, 0xFFFFFFAA, "{FF0000}[Errore:]{FFFFFF} Non sei dallo spacciatore"); } return 0; } if(Muted[playerid]) { SendClientMessage(playerid, COLOR_RED, "{F00000}[Errore:]{FFFFFF} Non puoi parlare, sei Muto."); return 0; } new idx; tmp = strtok(text, idx); if((strcmp("(", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("("))) { if(text[1] != 0) { format(string, sizeof(string), "(( [LOCAL OOC:] %s dice: %s ))", PlayerName(playerid),text[1]); ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); OOCLog(string); return 0; } } if(RegistrationStep[playerid] == 1) { /*new age = strval(text); if (age >= 16 && age <= 100) { new wstring[128]; format(wstring, sizeof(wstring), "{F0F000}[Info:]{FFFFFF} Hai settato l'etа: %d.", age); SendClientMessage(playerid,COLOR_LIGHTYELLOW2, wstring); PlayerInfo[playerid][pAge] = age; RegistrationStep[playerid] = 2; SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"{F0F000}[Info:]{FFFFFF} Che sesso sei? Digitare, Uomo o Donna"); } else { SendClientMessage(playerid,COLOR_RED,"{F0F000}[Info:]{FFFFFF} Etа Invalida, digitare tra 16-100."); } */ return 0; } if(RegistrationStep[playerid] == 2) { /*new idx2; tmp = strtok(text, idx2); if((strcmp("male", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("uomo"))) { PlayerInfo[playerid][pSex] = 1; SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "{F0F000}[Info:]{FFFFFF} Hai settato il sesso: Uomo"); RegistrationStep[playerid] = 0; TogglePlayerControllable(playerid,1); PlayerInfo[playerid][pRegistered] = 1; return 0; } else if((strcmp("female", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("donna"))) { PlayerInfo[playerid][pSex] = 2; SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "{F0F000}[Info:]{FFFFFF} Hai settato il sesso: Donna"); RegistrationStep[playerid] = 0; TogglePlayerControllable(playerid,1); PlayerInfo[playerid][pRegistered] = 1; return 0; } else { SendClientMessage(playerid, COLOR_RED, "{F0F000}[Info:]{FFFFFF} Sesso Invalido, digitare Uomo/Donna"); } */ return 0; } if(TalkingLive[playerid] != 255) { GetPlayerName(playerid, sendername, sizeof(sendername)); if(PlayerInfo[playerid][pFaction] == 7) { format(string, sizeof(string), "Giornalista %s: %s", sendername, text); OOCNews(COLOR_ORANGE, string); } else { format(string, sizeof(string), "Intervistato %s: %s", sendername, text); OOCNews(COLOR_LIGHTGREEN, string); } return 0; } if(Mobile[playerid] == 911) { format(string, sizeof(string), "[911:] %s(ID:%d) dice: %s",GetPlayerNameEx(playerid),playerid,text); SendFactionTypeMessage(1, COLOR_LSPD, string); SendClientMessage(playerid,COLOR_WHITE,"Operatore dice: La chiamata и stata registrata, si prega di attendere."); Mobile[playerid] = 255; format(string, sizeof(string), "[Telefono] %s: %s", GetPlayerNameEx(playerid), text); ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); return 0; } if(Mobile[playerid] != 255) { format(string, sizeof(string), "[Telefono:] %s: %s", GetPlayerNameEx(playerid), text); ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); if(IsPlayerConnected(Mobile[playerid])) { if(Mobile[Mobile[playerid]] == playerid) { new Float:SpeakerX,Float:SpeakerY,Float:SpeakerZ; GetPlayerPos(playerid,SpeakerX,SpeakerY,SpeakerZ); if(!PlayerToPoint(20.0,Mobile[playerid],SpeakerX,SpeakerY,SpeakerZ)) { SendClientMessage(Mobile[playerid], COLOR_LIGHTGREEN,string); SendClientMessage(playerid, COLOR_LIGHTGREEN,string); } if(SpeakerPhone[Mobile[playerid]]) { format(string, sizeof(string), "[Vivavoce] %s: %s", GetPlayerNameEx(playerid), text); ProxDetector(20.0, Mobile[playerid], string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); } } } else { SendClientMessage(playerid, COLOR_LIGHTYELLOW2,"{F00000}[Errore:]{FFFFFF} Non c'и nessuno in Linea."); } return 0; } if (realchat) { if(gPlayerLogged[playerid] == 0) { return 0; } if(!IsPlayerInAnyVehicle(playerid) || IsABike(GetPlayerVehicleID(playerid))) { if(AdminDuty[playerid] == 1) { format(string, sizeof(string), "{FFFFFF}%s Dice: %s", GetPlayerNameEx(playerid), text); ProxDetector(20.0, playerid, string,0x4CFF00FF,0x4CFF00FF,0x4CFF00FF,0x4CFF00FF,0x4CFF00FF); } else { if( UsoMask[playerid] == 1 ) { format(string, sizeof(string), "{FFFFFF}Sconosciuto Dice: %s", text); ProxDetector(20.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE); ChatAnimation(playerid); } else { format(string, sizeof(string), "{FFFFFF}%s Dice: %s", GetPlayerNameEx(playerid), text); ProxDetector(20.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE); TalkLog(string); ChatAnimation(playerid); } } } else { if(CarWindowStatus[GetPlayerVehicleID(playerid)] == 1) { if(AdminDuty[playerid] == 1) { format(string, sizeof(string), "{FFFFFF}%s Dice: %s", GetPlayerNameEx(playerid), text); ProxDetector(20.0, playerid, string,0x4CFF00FF,0x4CFF00FF,0x4CFF00FF,0x4CFF00FF,0x4CFF00FF); } else { if( UsoMask[playerid] == 1 ) { format(string, sizeof(string), "[Finestrino Chiuso:] {FFFFFF}Sconosciuto Dice: %s", text); ProxDetector(5.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE); } else { format(string, sizeof(string), "[Finestrino Chiuso:] {FFFFFF}%s Dice: %s", GetPlayerNameEx(playerid), text); ProxDetector(5.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE); } } } else { if(AdminDuty[playerid] == 1) { format(string, sizeof(string), "{FFFFFF}%s Dice: %s", GetPlayerNameEx(playerid), text); ProxDetector(20.0, playerid, string,0x4CFF00FF,0x4CFF00FF,0x4CFF00FF,0x4CFF00FF,0x4CFF00FF); } else { if( UsoMask[playerid] == 1 ) { format(string, sizeof(string), "[Finestrino Aperto:] {FFFFFF}Sconosciuto Dice: %s", text); ProxDetector(10.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE); } else { format(string, sizeof(string), "[Finestrino Aperto:] {FFFFFF}%s Dice: %s", GetPlayerNameEx(playerid), text); ProxDetector(10.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE); } } } } return 0; } return 1; }