Advertisement
whiplk

[CODE] - KickEx(with reason)

Jul 3rd, 2013
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.75 KB | None | 0 0
  1. /*
  2.     Coded by: Willian Luigi.
  3.     Language: C++(Pawn plug-in).
  4.     Example of kickPlayerEx(with reason).
  5.     OBS: a mensagem vale para todos menos para o player que estava levando o kick.
  6. */
  7. cell AMX_NATIVE_CALL kickPlayer(AMX* amx, cell* params)
  8. {
  9.     cell* addr = (0);
  10.     char* motivo = (NULL);
  11.     char temp[128];
  12.     int
  13.         tam = (0);
  14.  
  15.     amx_GetAddr(amx, params[2], &addr);
  16.     amx_StrLen(addr, &tam);
  17.     motivo = new char[tam + 1];
  18.     amx_GetString(motivo, addr, NULL, tam);
  19.     sprintf(temp, "id %d foi kikado por: %s", params[1], motivo);
  20.     if (g_Invoke->callNative(&PAWN::SendClientMessageToAll, -1, temp))
  21.     {
  22.         delete[] motivo;
  23.     }
  24.     g_Invoke->callNative(&PAWN::Kick, params[1]);
  25.     return logprintf("(kickPlayer log): Player %d kikado com sucesso.", params[1]), 1;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement