11.07.2017, 09:01
Bueno pase este Fs de nicks coloridos a mi GM,
y todo bien, pero cuando le aсadi el code donde: public OnPlayerDisconnect(playerid, reason) Hace bug en mi GM y no carga el dinero ni el score, ni el texdraw del sv se bugeaa,
asi lo puse;
y como ven, necesita ese code para poder apagar el colornicks al desconectarse. alguna sugerencia?
Код:
#define FILTERSCRIPT #include <a_samp> //Forwards forward Rcolor(playerid); forward Rcolor2(playerid); forward Rcolor3(playerid); forward Rcolor4(playerid); //Defines #define Rcoloresxd 3145 //News new DetenerRc[MAX_PLAYERS]; new DetenerRc1[MAX_PLAYERS]; new DetenerRc2[MAX_PLAYERS]; new DetenerRc3[MAX_PLAYERS]; // new RandomColores1[] = { 0xFF0000CA, 0x00FF00CA }; new RandomColores2[] = { 0xFFFF00CA, 0x00FFFFCA }; new RandomColores3[] = { 0xFF00FFCA, 0x3406FFFF }; new RandomColores4[] = { 0x9BA2ABE4, 0x8B4513FF }; #if defined FILTERSCRIPT public OnFilterScriptInit() { return 1; } public OnFilterScriptExit() { return 1; } #endif public OnPlayerConnect(playerid) { return 1; } public OnPlayerDisconnect(playerid, reason) { KillTimer(DetenerRc[playerid]); KillTimer(DetenerRc1[playerid]); KillTimer(DetenerRc2[playerid]); KillTimer(DetenerRc3[playerid]); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/Rcolores", cmdtext, true)) { ShowPlayerDialog(playerid, Rcoloresxd, DIALOG_STYLE_LIST, "{FFFFFF}Random Colores", "{FFFFFF}Random Color: {FF0000}Rojo {FFFFFF}y {00FF44}verde\n\ {FFFFFF}Random Color: {F7FF00}Amarillo {FFFFFF}y {00FCFF}Celeste Agua\n\ {FFFFFF}Random Color: {FF00EB}Rosa {FFFFFF}y {000DFF}Azul\n\ {FFFFFF}Random Color: {C9C9C9}Gris {FFFFFF}y {C96800}Marron\n\ {FFFFFF}Detener colores Random\n", "Cambiar", "Cancelar"); return 1; } return 0; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == Rcoloresxd) { if(response) { switch (listitem) { case 0: { SendClientMessage(playerid, -1, "{FFFFFF}* Activaste el color {FF0000}Rojo {FFFFFF}y {00FF44}verde {FFFFFF}en tu Nick."); DetenerRc[playerid] = SetTimerEx("Rcolor", 1000, true, "i", playerid); KillTimer(DetenerRc1[playerid]); KillTimer(DetenerRc2[playerid]); } case 1: { SendClientMessage(playerid, -1, "{FFFFFF}* Activaste el color {F7FF00}Amarillo {FFFFFF}y {00FCFF}Celeste Agua {FFFFFF}en tu Nick."); DetenerRc1[playerid] = SetTimerEx("Rcolor2", 1000, true, "i", playerid); KillTimer(DetenerRc[playerid]); KillTimer(DetenerRc2[playerid]); } case 2: { SendClientMessage(playerid, -1, "{FFFFFF}* Activaste el color {FF00EB}Rosa {FFFFFF}y {000DFF}Azul {FFFFFF}en tu Nick."); DetenerRc2[playerid] = SetTimerEx("Rcolor3", 1000, true, "i", playerid); KillTimer(DetenerRc[playerid]); KillTimer(DetenerRc1[playerid]); KillTimer(DetenerRc3[playerid]); } case 3: { SendClientMessage(playerid, -1, "{FFFFFF}* Activaste el color {C9C9C9}Gris {FFFFFF}y {C96800}Marron {FFFFFF}en tu Nick."); DetenerRc3[playerid] = SetTimerEx("Rcolor4", 1000, true, "i", playerid); KillTimer(DetenerRc[playerid]); KillTimer(DetenerRc2[playerid]); KillTimer(DetenerRc1[playerid]); } case 4: { SendClientMessage(playerid, -1, "{FFFFFF}* Has detenido los colores Random en tu Nick."); KillTimer(DetenerRc[playerid]); KillTimer(DetenerRc1[playerid]); KillTimer(DetenerRc2[playerid]); KillTimer(DetenerRc3[playerid]); } } } } return 1; } //Colores public Rcolor(playerid) { new rand = random(sizeof(RandomColores1)); SetPlayerColor(playerid, RandomColores1[rand]); return 1; } public Rcolor2(playerid) { new rand = random(sizeof(RandomColores2)); SetPlayerColor(playerid, RandomColores2[rand]); return 1; } public Rcolor3(playerid) { new rand = random(sizeof(RandomColores3)); SetPlayerColor(playerid, RandomColores3[rand]); return 1; } public Rcolor4(playerid) { new rand = random(sizeof(RandomColores4)); SetPlayerColor(playerid, RandomColores4[rand]); return 1; }
asi lo puse;
Код:
public OnPlayerDisconnect(playerid, reason) { if(IsNeonAttached[playerid] == true) { DestroyObject(Neon_Left[playerid]); DestroyObject(Neon_Right[playerid]); KillTimer(RainbowTimer[playerid]); IsNeonAttached[playerid] = false; } //-- Sistema Lazer --// SetPVarInt(playerid, "laser", 0); RemovePlayerAttachedObject(playerid, 0); //-- --// EstaEnFly[playerid] = 0; NitroEnMoto[playerid] = 0; ColorAzulChat[playerid] = 0; vKnockOut[playerid] = 1; ramped[playerid] = 1; UserEnJuego[playerid] = 0; DMZone[playerid] = 0; DMZone2[playerid] = 0; DMZone3[playerid] = 0; pDesmadre[playerid] = 0; pDesmadre2[playerid] = 0; SelectedPlayer[playerid]=-1; pPaintball[playerid] = 0; SendDeathMessage(INVALID_PLAYER_ID,playerid,201); if(OldCar[playerid] != INVALID_VEHICLE_ID) PassengerInCar[OldCar[playerid]][PassengerSeat[playerid]] = INVALID_PLAYER_ID; if(AccInfo[playerid][pCar] != -1) BorrarAuto(AccInfo[playerid][pCar]); ResetPlayerVarDisconnect(playerid); if(udb_Exists(PlayerName2(playerid))) dUserSetINT(PlayerName2(playerid)).("loggedin",0); RemovePlayerAttachedObject(playerid, 0); RemovePlayerAttachedObject(playerid, OBlevel); RemovePlayerAttachedObject(playerid, SLOT_LEVEL); CarDeleter(PlayerCar[playerid][0]); KillTimer(Actualiza[playerid]); for(new i = 0; i < MAX_PLAYERS; i++) { IrBloqueado[playerid][i] = 1; } if(GetPVarInt(playerid, "Reconnecting") == 1) { new iStr[128],iP[16]; GetPVarString(playerid, "RecIP", iP, sizeof(iP)); printf("%s", iP); format(iStr, sizeof(iStr), "unbanip %s", iP); SendRconCommand(iStr); SendRconCommand("reloadbans"); SetPVarInt(playerid, "Reconnecting", 0); } else { KillTimer(DetenerRc[playerid]); KillTimer(DetenerRc1[playerid]); ////FS SISTEMA DE COLORNICK AGREGADO AL GM, LA CUAL HACE BUG DE KillTimer(DetenerRc2[playerid]);//// DINERO Y SCORE E TEXDRAW KillTimer(DetenerRc3[playerid]); return 1; }