31.10.2013, 04:37
Buenas, quisiera saber como le pongo una restricciуn a "public Comprobar(playerid)" para que cuando alguien muera no le enviй el mensaje de que usa cheat, ya que voy a cambiar el mensaje por banear.
Lo que ocurre es que cuando alguien muere, se le quitan las armas con "ClearGuns" que lo coloque en "OnPlayerDeath" en vez de "ResetPlayerWeapons" porque con el "ResetPlayerWeapons" envнa el mensaje 100% seguro.
PD: El timer para "Comprobar" es de 10 segundos, lo cual provoca que con el "Clearguns" aveces cuando muero me manda el mensaje, y aveces no.
Soy novato en esto, les agradecerнa mucho si tienen una mejor soluciуn.
Lo que ocurre es que cuando alguien muere, se le quitan las armas con "ClearGuns" que lo coloque en "OnPlayerDeath" en vez de "ResetPlayerWeapons" porque con el "ResetPlayerWeapons" envнa el mensaje 100% seguro.
PD: El timer para "Comprobar" es de 10 segundos, lo cual provoca que con el "Clearguns" aveces cuando muero me manda el mensaje, y aveces no.
Код:
forward Comprobar_Cheat(playerid); public Comprobar_Cheat(playerid) { if(IsPlayerConnected(playerid)) { for (new W = 0; W < 13; W++) { GetPlayerWeaponData(playerid, W, temp_arm[W][0], temp_arm[W][1]); if(temp_arm[W][0] != pGun[playerid][W]) { GetPlayerName(playerid, w_nombre, sizeof(w_nombre)); format(w_str, sizeof(w_str), "**[AVISO]: - Revisб a %s(%i), posible cheat. - **", w_nombre, playerid); for(new i = 0; i < GetMaxPlayers(); i++) { if(IsPlayerAdmin(i) && IsPlayerConnected(i)) { SendClientMessage(i, COLOR_RED, w_str); } } } } } return 1; }
Код:
public ClearGuns(playerid) { for(new slot = 0; slot < 13; slot++) { Armas[playerid][slot] = 0; Municion[playerid][slot] = 0; } EntregarArma(playerid, 0, 1); PlayerInfo[playerid][pGun0] = 0; EntregarArma(playerid, 0, 1); PlayerInfo[playerid][pGun1] = 0; EntregarArma(playerid, 0, 1); PlayerInfo[playerid][pGun2] = 0; EntregarArma(playerid, 0, 1); PlayerInfo[playerid][pGun3] = 0; EntregarArma(playerid, 0, 1); PlayerInfo[playerid][pGun4] = 0; EntregarArma(playerid, 0, 1); PlayerInfo[playerid][pGun5] = 0; EntregarArma(playerid, 0, 1); PlayerInfo[playerid][pGun6] = 0; EntregarArma(playerid, 0, 1); PlayerInfo[playerid][pGun7] = 0; EntregarArma(playerid, 0, 1); PlayerInfo[playerid][pGun8] = 0; EntregarArma(playerid, 0, 1); PlayerInfo[playerid][pGun9] = 0; EntregarArma(playerid, 0, 1); PlayerInfo[playerid][pGun10] = 0; EntregarArma(playerid, 0, 1); PlayerInfo[playerid][pGun11] = 0; EntregarArma(playerid, 0, 1); PlayerInfo[playerid][pGun12] = 0; return 1; }